Need Help Sending Bulk Data in Multiple Fields Using SIM808 ASAP

ruzbeh biglari on 21 Oct 2021
Latest activity Edit by Christopher Stapels on 22 Oct 2021

Greetings!

So, I'm working on a project that needs to send collected data using a SIM808 over GPRS to ThingSpeak to multiple fields. The upload interval is 2 minutes with samples taken every 10 seconds and each batch of samples includes 19 bytes of data (12 sets of 19 bytes equal 228B for each bulk data pack that has to be sent and the memory can be flushed). It's worth mentioning that I'm using an Arduino Pro Mini (ATmega328P).

I've looked at the bulk data upload example, and I'm having some trouble adapting it to the SIM808. I am also not sure how to send multiple fields using the bulk method. Unfortunately, I don't have much time to tinker with the code as the whole project had to be done in 2 days and I've only got one day to finish. I'd appreciate any help regarding this as I'm on a very tight schedule.

Thanks in advance!

Christopher Stapels
Christopher Stapels on 22 Oct 2021 (Edited on 22 Oct 2021)

Here is the body format for a POST to the bulk endpoint. You can see each field date is appended as another member in the array of updates.

{
	"write_api_key": "WRITE_API_KEY",
	"updates": [{
			"created_at": "DATETIME_STAMP",
			"field1": FIELD1_VALUE,
			"field2": FIELD2_VALUE,
			"field3": FIELD3_VALUE,
			"field4": FIELD4_VALUE,
			"field5": FIELD5_VALUE,
			"field6": FIELD6_VALUE,
			"field7": FIELD7_VALUE,
			"field8": FIELD8_VALUE,
			"Latitude": LATITUDE_VALUE,
			"Longitude": LONGITUDE_VALUE,
			"Elevation": ELEVATION_VALUE,
			"Status": "STATUS_STRING"
		},
		{
			"created_at": "DATETIME_STAMP",
			"field1": "FIELD1_VALUE",
			Etc...
		}
	]
}