Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Sheets Publishing Platform does not send Multiplexer Data #159

Open
rijdmc419 opened this issue Aug 23, 2021 · 1 comment
Open

Google Sheets Publishing Platform does not send Multiplexer Data #159

rijdmc419 opened this issue Aug 23, 2021 · 1 comment

Comments

@rijdmc419
Copy link

rijdmc419 commented Aug 23, 2021

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:

  1. Go to 'Examples'
  2. Click on 'Loom' -> 'GoogleSheetsWiFi'
  3. Enter in your WiFi in the config file, along Google Sheets information
  4. Enable Multiplexer
  5. Run
  6. 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.

@lucasballr
Copy link

Is the device returning correct data in the Loom.displayData() function in the serial monitor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants