GPS - MQTT- RaspberryPi


#1

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]

co-ords are edited etc. :wink:

What is it expecting to see ?


#2

try changing:

to:

 client.virtualWrite(11,[msg.latitude,msg.longitude,msg.altitude],"gps","m")

#3

I’ll give that a go tomorrow :slightly_smiling_face:
thanks.


#4

As far as I know GPS widgets are only supported with LoRA devices. Is that still true @shramiksalgaonkar?


#5

thanks @adam for reporting this. @bensimmo this feature has been disable and not supported with MQTT devices.


#6

Shame, part of a map shows up and why just LoRa, data is data.

Oh well, I’ll have to look for somewhere that does :slight_smile:


#7

Any news on that development @shramiksalgaonkar?


#8

@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.

@shramiksalgaonkar 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.


#9

switching to ‘m’ worked, the Website shows my position and the map now :slight_smile:
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 :laughing:

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;-) :shushing_face: )


#10

As @acedeno stated it needs more development and will be out by the end of the year. the App does not support the map feature yet.

this is a nice suggestion. we will take into consideration.