bertrik / LoraWanPmSensor

Particulate matter sensor using LoRaWAN as the transport mechanism
https://revspace.nl/LoraWanDustSensor
MIT License
11 stars 5 forks source link

No TTS connection #5

Open reivis opened 2 years ago

reivis commented 2 years ago

Hello,

After filling in the credentials for the TTS in Lorawanpmsensor.ino and upload the files in Platformio I can get any connections. Also is the display of my Heltec disabled. Can somebody tell me the problem. I also got in my output from my Platformio console the follow errors:

[{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/heltecv2/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 37, "startColumn": 1, "endLineNumber": 37, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/heltecv2/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 100, "startColumn": 1, "endLineNumber": 100, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/heltecv2/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 139, "startColumn": 1, "endLineNumber": 139, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/heltecv2/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 166, "startColumn": 1, "endLineNumber": 166, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/heltecv2/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 250, "startColumn": 1, "endLineNumber": 250, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/heltecv2/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 473, "startColumn": 1, "endLineNumber": 473, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/heltecv2/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 573, "startColumn": 1, "endLineNumber": 573, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/heltecv2/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 627, "startColumn": 1, "endLineNumber": 627, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/heltecv2/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 768, "startColumn": 1, "endLineNumber": 768, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/ttgov1/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 37, "startColumn": 1, "endLineNumber": 37, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/ttgov1/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 100, "startColumn": 1, "endLineNumber": 100, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/ttgov1/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 139, "startColumn": 1, "endLineNumber": 139, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/ttgov1/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 166, "startColumn": 1, "endLineNumber": 166, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/ttgov1/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 250, "startColumn": 1, "endLineNumber": 250, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/ttgov1/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 473, "startColumn": 1, "endLineNumber": 473, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/ttgov1/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 573, "startColumn": 1, "endLineNumber": 573, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/ttgov1/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 627, "startColumn": 1, "endLineNumber": 627, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.pio/libdeps/ttgov1/QRCode/src/qrcode.c", "owner": "cpp", "severity": 4, "message": "ignoring #pragma mark [-Wunknown-pragmas]", "startLineNumber": 768, "startColumn": 1, "endLineNumber": 768, "endColumn": 1 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.vscode/c_cpp_properties.json", "owner": "c:\Users\Reivis\Downloads\LoraWanPmSensor-master\LoraWanPmSensor-master", "severity": 4, "message": "Cannot find \"c:\Users\Reivis\Downloads\LoraWanPmSensor-master\LoraWanPmSensor-master\include\".", "startLineNumber": 11, "startColumn": 17, "endLineNumber": 11, "endColumn": 98 },{ "resource": "/c:/Users/Reivis/Downloads/LoraWanPmSensor-master/LoraWanPmSensor-master/.vscode/c_cpp_properties.json", "owner": "c:\Users\Reivis\Downloads\LoraWanPmSensor-master\LoraWanPmSensor-master", "severity": 4, "message": "Cannot find \"c:\Users\Reivis\Downloads\LoraWanPmSensor-master\LoraWanPmSensor-master\include\".", "startLineNumber": 114, "startColumn": 21, "endLineNumber": 114, "endColumn": 102 }]

bertrik commented 2 years ago

There is no requirement to fill in te deveui/appeui or appkey in the source code.

The idea is that the source code is the same for all nodes of the same type. Each ESP32 has a built-in unique code that is used as the device EUI. The app EUI is the same for all devices. The app key is the same for all devices.

You should enter all of these number in the TTN console, not change them in the device firmware. Currently, the device EUI is shown on screen (top line). The app EUI is 70B3D57ED001A09B (aka JOIN EUI) The app key is AA9F12457F0664DF4C1E9FC95EDA1A8A The credentials are also shown on join, format is "OTAA:appeui:deveui:appkey'

If you want, you can change the credentials over the built-in serial console, using the 'otaa' command. pio device monitor Then type 'help' for example.

The plan is to eventually have a unique app key for devices, generated on first startup, then flashed into the device. These credentials (including the key) are shown in the QR code on the display when trying to join the network. You can then scan the QR code (e.g. using your phone) and type the credentials into the TTN console.

The display goes off after some time, to avoid the OLED from "burning" in. A press on the button enables display again. You can attach an external 128x64 pixel display on the OLED SDA/SCL pins (+ VCC/GND). If it detects the external display, the internal display stays off, again to avoid it from burning in.

reivis commented 2 years ago

Ok, thanks for your clear explanation. So my device is now seen in TTS. Every minute I got a joint but no payload is sending by the node. Do I miss something?

Regards Reinier

ThatRed commented 3 days ago

Hello @reivis, did you ever get the payload data in the TTN console? I had the same problem and after exchanging the antenna I got data in the console. The Sensor needs to send and receive information from the gateway. So I think you are very close to get your data.

I first looked at https://www.thethingsnetwork.org/community/ and searched for my city to see where the sensor is in relation to the gateway. Then I exported the communication in the console and found gps coordinates from the gateway and figured out that I‘m at the edge of the gateway radius. (I don’t know if every gateway sends it gps position.)

The next problem is finding an antenna that is really turned to 868MHz. Most offers on Amazon or Aliexpress say they are tuned to 868MHz but in reality they are closer to the American frequency of 915MHz. So reading the comments might help and buying different antennas and try them. Or look for the shop that sells good antennas or find someone built, test and sells them.

Good luck!