Loom
Loom copied to clipboard
Google Sheets Publishing Platform does not send Multiplexer Data
Describe the bug When I attempt to run the Google Sheets WiFi Publish example it I get a run time error of: [Goog] Publish data is invalid: contents is not an array [Goog] Could not publish without valid data.
Hardware in Use I am using a Multiplexer with the I2C sensors : TSL2591, SHT31D, STEMMA
To Reproduce Steps to reproduce the behavior:
- Go to 'Examples'
- Click on 'Loom' -> 'GoogleSheetsWiFi'
- Enter in your WiFi in the config file, along Google Sheets information
- Enable Multiplexer
- Run
- See error in Serial Monitor
Expected behavior The Serial Monitor will successfully show that all the modules were instantiated and the sensors are working. After the first packet is sent there will be an error showing: [Goog] Publish data is invalid: contents is not an array [Goog] Could not publish without valid data.
Code
/////////////////////////////////////////////////////////////////////////////// // This is the simplest example of logging data to Google Sheets // The only difference between this example an 'Basic' is the LoomFactory // settings, the line: // Feather.GoogleSheets().publish(); // and the configuration, enabling logging to Google Sheets. // In the config, you need: // - WiFi network name and password (or '' if no password) // - For Google sheets parameters, see: // https://github.com/OPEnSLab-OSU/Loom/wiki/Using-Loom-with-Google-Sheets /////////////////////////////////////////////////////////////////////////////// #include <Loom.h> // Include configuration const char* json_config = #include "config.h" ; // In Tools menu, set: // Internet > WiFi // Sensors > Enabled // Radios > Disabled // Actuators > Enabled // Max > Disabled using namespace Loom; Loom::Manager Feather{}; void setup() { Feather.begin_serial(true); Feather.parse_config(json_config); Feather.print_config(); LPrintln("\n ** Setup Complete ** "); } void loop() { Feather.measure(); Feather.package(); Feather.display_data(); getGoogleSheets(Feather).publish(); Feather.pause(); }
Config
"{\ 'general':\ {\ 'device_name':'Device',\ 'instance_num':1,\ 'interval':3000\ },\ 'components':[\ {\ 'name':'Analog',\ 'params':'default'\ },\ {\ 'name':'Digital',\ 'params':'default'\ },\ {\ 'name':'WiFi',\ 'params':['<ssid>','<password>']\ },\ {\ 'name':'GoogleSheets',\ 'params':[\ 'Goog',\ 7002,\ '/macros/s/<your-script-id>/exec',\ '<your-sheet-id>',\ /*true to autoname tab*/ true,\ /*not used if previous param is true*/ '<your-tab-name>'\ ]\ }\ ]\ }"
Additional context
I looked into the Loom 2.5 source code and it was getting stuck at the function: bool LoomPublishPlat::m_validate_json(const JsonObjectConst json) const which is then resulting in .publish() returning an error.
Is the device returning correct data in the Loom.displayData() function in the serial monitor?