Agree on the lack of some simple py.examples actualy within the BYOD devices section. The Docs section has been Very nicely set out with screen and video capture for C with 4 standard approaches. Nice work.
I have been chipping away with almost zero py skills so it has taken me months to get a clean and simple base level python serial approach for Pi using based on:
git clone https://github.com/myDevicesIoT/Cayenne-MQTT-Python
sudo python setup.py install
The approach I use does not seem to need any third party patches or extra modules. My py scripts seem to work well. I can post up my naieve draft chippings up if needed. In my case I am “Reading, Pi GPIO tty(Serial) CSV Data, Verifying CheckSum, Slicing ‘Channel Data’ ‘A’ > ‘Z’ (could be x,y,z as in above) and Dicing data to a Float then Posting” This has cracked open a nice serial based approach. A simple and reliable method of posting data into Cayenne BYOD via MQTT. A cron script / patch to delay start on boot is only tweak needed. My test examples have been running solid for month+.
The ‘Serial TTL Pack and Post Method’ here is a modular code + hardware concept: PI GPIO TTL Serial data jumpers hard wired Tx/Rx data and -ve from the micro / sensor / radio of choice. ( A third wire +ve 5v /3.3v cann be used to supply power to the miro / sensor / radio )
This opens up potential for diverse sensors and tech. E.g. long range simple transparent radio devices such as the serial bridge HC-12 (1km), LoRaSerial (10km). This I find is a neat standard modular interface for a diverse range of projects and technology in the lab or classroom. Any micro or any Thing that can emit a comprehensible string of CSV serial data can be fed into Cayenne via the Pi GPIO header. As long as a simple CSV sentence matches the expectaions of the highly hackable base pi py script. Great for education, debugging and learning some low level base concepts: Adding a few py.print line test points to see what is going on, or Installing Minicom and looking at data. Low tech serial I know. But it works.
Handing the data over to Cayenne MQTT BYOD is the exciting part I love to sit back, and watch the cheerful little green boxes pop up on the browser… That is what we say “The icing on the cake” (frosting)
( I am passing Lat Lon at present and note the float handles down to 5 digit decimal )
Getting data flowing in the opposite direction From Cayenne will take a bit more time at my rate but someone will be able to work out a parallel approach