PANS R2 - Record tag positions on highest update rate from gateway?

New version of PANS looks great and more stable and thank for this version. Web interface works great but still need some improvements like recording positions , auto ranging for anchors…

But i still have a problem to get tag positions on highest update rate and record. There is no sample to get this in c or python.

Is there a documentation to use dwm-daemon to get all tag positions from gateway ? When i tried to get from shell it’s still not event close to 10hz.

1 Like

Hi there,

which shell command/script have you used?

You can use something like this on the Raspberry PI to log all the data with some rough timestamps:
$ sudo apt-get install moreutils
$ mosquitto_sub -v -h localhost -t ‘dwm/#’ | ts ‘[%Y-%m-%d %H:%M:%S]’

Please check also the range between the Tag and the Gateway. When correctly installed, the 10 Hz should work with reception rate better than 99%.

Cheers,
TDK

2 Likes

If deamon sends all data with mqtt i can subscribe dwm/# topic easly :slight_smile: Thats Great :slight_smile:

Raw form of data below :slight_smile:

{“networkId”:65535,“ipAddress”:[“192.168.5.42”,“172.17.0.1”]}

qos : 0, retain : true, cmd : publish, dup : false, topic : dwm/gateway/b827eb8cedfc/uplink, messageId : , length : 94, Raw payload : 12334110101116119111114107731003458545353515344341051126510010011410111511534589134495750464954564653465250344434495550464955464846493493125

Hi,

I am not sure if the raw data comment was a question or just a confirmation?
Is your problem with the low reception rate solved?

Cheers,
TDK

I wrote small python script to get MQTT messages and save them in to mysql database.
You can modify this.
import mysql.connector
import paho.mqtt.subscribe as subscribe
import json
import datetime
import random

cnx = mysql.connector.connect(user='username', password='password', host='localhost', database='hrSession')
cursor = cnx.cursor()
 
 
def on_message(client, userdata, message):
    parsedmsg = json.loads(message.payload.decode('utf-8'))
    print(parsedmsg)
    #v = random.randint(1, 200)
    v = parsedmsg['v']
    print(v)
    t = datetime.datetime.now()
    print(t)
    #s = "s1"
    s = parsedmsg['s']
    print(s)
    sql = "insert into hrsession (s,t,v) values ('%s', '%s', %s);" % (s,t,v)
    print(sql)
    cursor.execute(sql)
    cnx.commit()
    print('hikmet')
 
 
subscribe.callback(on_message, "pp", hostname="localhost")
4 Likes