Closed proffalken closed 5 years ago
Since data is arriving this looks like a conversion problem on TTN console side. Did you put anything in the encoder tab? If so, delete it. You need the decoder and the converter.
If the problem persists, delete all entries from all payload format tabs in TTN console, then copy/paste the raw data seen in console to here.
Thanks.
I've removed all of the decoders/encoders/converters and the raw data is as follows:
{
"time": "2019-02-25T15:29:35.574791447Z",
"frequency": 868.5,
"modulation": "LORA",
"data_rate": "SF7BW125",
"coding_rate": "4/5",
"gateways": [
{
"gtw_id": "ttnp-25-gw1",
"gtw_trusted": true,
"timestamp": 381172555,
"time": "",
"channel": 2,
"rssi": -55,
"snr": 7,
"rf_chain": 1,
"latitude": <CORRECT LAT>,
"longitude": -<CORRECT LNG>
}
]
}
What's really weird is that everything seems to be coming in via port 1 with multiple payload lengths, whereas I thought things would be coming in on different ports - is that just for the plain decoder?
A sample payload is 15650000148807E87AFF95CB001A90
Yup, this is latest master, and this is a brand new setup in TTN - new app, devices, everything.
I'll dive into the code and shotgun debug with a few println
's and see what I can get out of it
@proffalken Allright, here's the solution: You're using Payload Encoder Type "3", this Cayenne LPP 2.0 format. The above sample payload contains a Wifi count (value 0) and a GPS location value.
Probably the code was compiled with a paxcounter.conf
file containing the line
#define PAYLOAD_ENCODER 3
The default setting, needed for packed decoder/converter is
#define PAYLOAD_ENCODER 2
Please make sure you have the correct setting in paxcounter.conf
and rebuild & reflash code.
Important: Press "Clean" before "build" in platformio, since for some reason modifications in the .conf file sometimes are not recompiled by platformio.
@proffalken You can validate on your device which payload encoder was compiled. See console output during startup. Payload encoding is listed on the line starting with Features:. If you see LPPDYN
here, not PACKED
, the wrong encoder was compiled.
OK, no idea what caused it, but after following the instructions for the vim plugin and modifying the make file, then running make clean
and make upload
, it now works...
I'm more than happy to put this down to User Error and close this off.
Thanks anyway :)
Hi folks,
I've followed the tutorial in the README file and I've got data flowing in to my TTN app, however the values are all over the place:
This is from a device currently running in my house, with (at the very most!) 15 WiFi and 4 bluetooth devices in range.
My
paxcounter.conf
has the following content:And I'm uploading via the command line using
platformio run -t upload
I've uploaded the "packed" decoder and encoder from https://github.com/cyberman54/ESP32-Paxcounter/blob/master/src/TTN/packed_decoder.js and https://github.com/cyberman54/ESP32-Paxcounter/blob/master/src/TTN/packed_converter.js to TTN console, but the data is wildly inaccurate.
I'm sure it's just me, but what am I doing wrong?!