I’m currently playing with GPS and sending on a RaspberryPi via Cayenne MQTT in Python3
using
import serial #to read from serial UART gpio pins 14/15, raspi-config -> 'Serial' -> disable console, enable serial port and reboot.
import pynmea2 #NMEA GPS splitter, sudo apt install pynmea2, on Raspbian
--(Cayenne mqtt imports and setup)--
def gps_go():
print("gps is go")
serialPort = serial.Serial("/dev/serial0", 9600, timeout=0.5)
while True:
strip = serialPort.readline()
#print(strip)
if strip.find(b'GGA') > 0:
msg = pynmea2.parse(strip.decode('utf-8'))
print(msg.latitude,msg.longitude,msg.altitude)
client.virtualWrite(11,[msg.latitude,msg.longitude,msg.altitude],"gps","gps")
time.sleep(5)
and other bits for cayenne setup and to launch it in a thread.
But it’s not showing up the coordinates, a map shows up on the app/webpage
this is what is being sent
PUB v1/stuff/things/morestuff/data/11
gps,gps=[12.74024266666667, -0.89906450000000003, 31.4]
@bensimmo@adam Data type is supported. Feature development needs work. We will bring support for this as part of a roll-out of new features later this year/early next year.
@shramik_salgaonkar the feature hasn’t been “disabled”. It just hasn’t been “enabled” as it needs further development. My bad, I wasn’t clear earlier today.
We are making significant changes in our back-end, getting rid of a lot of legacy code/standards, making sure all our micro services scale nicely, optimizations, a lot of things under the hood. We have a big push expected by end of week or earlier next week depending how fast we can squash a few bugs. Users probably won’t see much change, but these are big changes we have been working for a few months now. We have at least 2 more waves of these type of changes that we want to complete before year end, and we will start focusing on a big list of features we want to bring forward. I think we should be able to squeeze a couple of them in between these big changes.
switching to ‘m’ worked, the Website shows my position and the map now
Seems to work at the basic level.
I’ve not tried to see if it maps as you move as it’s not quite portable yet and I forgot my battery.
The Android App is just a grey box and doesn’t work.
Not sure what I’m going to use it for yet, but got it working
Now if you have any cool visualisation ideas for showing data across a map… like a ‘heatmap’ for measurements. That’s probably the harder part. (from my perspective, i’ll ignore all that server database stuff that lets the magic happen;-) )