Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ABP hangup and add new getters #93

Open
wants to merge 43 commits into
base: master
Choose a base branch
from

Conversation

flhofer
Copy link

@flhofer flhofer commented Apr 28, 2021

Changed library version to match firmware v1.2.3, updated firmware with fixes to 1.2.3 from pull request 35

I've fixed a problem where the getJoinStatus function waited forever for a response as it parsed the wrong +OK response still in the buffer. Also a minor issue with the channel mask's char buffer.

Added getters for Power, RSSI, and SNR.

@CLAassistant
Copy link

CLAassistant commented Apr 28, 2021

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

Memory usage change @ e14aa72

Board flash % RAM for global variables %
arduino:mbed_portenta:envie_m4 🔺 0 - +64 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 🔺 0 - +256 0.0 - +0.03 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 🔺 0 - +216 0.0 - +0.08 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 🔺 0 - +216 0.0 - +0.08 0 - 0 0.0 - 0.0
Click for full report table
Board examples/DumbModemLoraSender
flash
% examples/DumbModemLoraSender
RAM for global variables
% examples/FirstConfiguration
flash
% examples/FirstConfiguration
RAM for global variables
% examples/LoraSendAndReceive
flash
% examples/LoraSendAndReceive
RAM for global variables
% examples/FWUpdaterBridge
flash
% examples/FWUpdaterBridge
RAM for global variables
% examples/MKRWANFWUpdate_standalone
flash
% examples/MKRWANFWUpdate_standalone
RAM for global variables
%
arduino:mbed_portenta:envie_m4 0 0.0 0 0.0 64 0.01 0 0.0 64 0.01 0 0.0
arduino:mbed_portenta:envie_m7 0 0.0 0 0.0 64 0.01 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 256 0.03 0 0.0
arduino:samd:mkrwan1300 0 0.0 0 0.0 60 0.02 0 0.0 64 0.02 0 0.0 0 0.0 0 0.0 216 0.08 0 0.0
arduino:samd:mkrwan1310 0 0.0 0 0.0 60 0.02 0 0.0 64 0.02 0 0.0 0 0.0 0 0.0 216 0.08 0 0.0
Click for full report CSV
Board,examples/DumbModemLoraSender<br>flash,%,examples/DumbModemLoraSender<br>RAM for global variables,%,examples/FirstConfiguration<br>flash,%,examples/FirstConfiguration<br>RAM for global variables,%,examples/LoraSendAndReceive<br>flash,%,examples/LoraSendAndReceive<br>RAM for global variables,%,examples/FWUpdaterBridge<br>flash,%,examples/FWUpdaterBridge<br>RAM for global variables,%,examples/MKRWANFWUpdate_standalone<br>flash,%,examples/MKRWANFWUpdate_standalone<br>RAM for global variables,%
arduino:mbed_portenta:envie_m4,0,0.0,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0
arduino:mbed_portenta:envie_m7,0,0.0,0,0.0,64,0.01,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,256,0.03,0,0.0
arduino:samd:mkrwan1300,0,0.0,0,0.0,60,0.02,0,0.0,64,0.02,0,0.0,0,0.0,0,0.0,216,0.08,0,0.0
arduino:samd:mkrwan1310,0,0.0,0,0.0,60,0.02,0,0.0,64,0.02,0,0.0,0,0.0,0,0.0,216,0.08,0,0.0

src/MKRWAN.h Outdated Show resolved Hide resolved
@github-actions
Copy link

Memory usage change @ fa55962

Board flash % RAM for global variables %
arduino:mbed_portenta:envie_m4 🔺 0 - +1136 0.0 - +0.11 💚 -8 - 0 -0.0 - 0.0
arduino:mbed_portenta:envie_m7 🔺 0 - +1752 0.0 - +0.22 💚 -8 - 0 -0.0 - 0.0
arduino:samd:mkrwan1300 🔺 0 - +1672 0.0 - +0.64 💚 -8 - 0 -0.02 - 0.0
arduino:samd:mkrwan1310 🔺 0 - +1664 0.0 - +0.63 💚 -8 - 0 -0.02 - 0.0
Click for full report table
Board examples/DumbModemLoraSender
flash
% examples/DumbModemLoraSender
RAM for global variables
% examples/FirstConfiguration
flash
% examples/FirstConfiguration
RAM for global variables
% examples/LoraSendAndReceive
flash
% examples/LoraSendAndReceive
RAM for global variables
% examples/FWUpdaterBridge
flash
% examples/FWUpdaterBridge
RAM for global variables
% examples/MKRWANFWUpdate_standalone
flash
% examples/MKRWANFWUpdate_standalone
RAM for global variables
%
arduino:mbed_portenta:envie_m4 0 0.0 0 0.0 1000 0.1 -8 -0.0 1136 0.11 -8 -0.0
arduino:mbed_portenta:envie_m7 0 0.0 0 0.0 1064 0.14 -8 -0.0 1136 0.14 -8 -0.0 0 0.0 0 0.0 1752 0.22 0 0.0
arduino:samd:mkrwan1300 0 0.0 0 0.0 1028 0.39 -8 -0.02 1132 0.43 -8 -0.02 0 0.0 0 0.0 1672 0.64 0 0.0
arduino:samd:mkrwan1310 0 0.0 0 0.0 1028 0.39 -8 -0.02 1136 0.43 -8 -0.02 0 0.0 0 0.0 1664 0.63 0 0.0
Click for full report CSV
Board,examples/DumbModemLoraSender<br>flash,%,examples/DumbModemLoraSender<br>RAM for global variables,%,examples/FirstConfiguration<br>flash,%,examples/FirstConfiguration<br>RAM for global variables,%,examples/LoraSendAndReceive<br>flash,%,examples/LoraSendAndReceive<br>RAM for global variables,%,examples/FWUpdaterBridge<br>flash,%,examples/FWUpdaterBridge<br>RAM for global variables,%,examples/MKRWANFWUpdate_standalone<br>flash,%,examples/MKRWANFWUpdate_standalone<br>RAM for global variables,%
arduino:mbed_portenta:envie_m4,0,0.0,0,0.0,1000,0.1,-8,-0.0,1136,0.11,-8,-0.0
arduino:mbed_portenta:envie_m7,0,0.0,0,0.0,1064,0.14,-8,-0.0,1136,0.14,-8,-0.0,0,0.0,0,0.0,1752,0.22,0,0.0
arduino:samd:mkrwan1300,0,0.0,0,0.0,1028,0.39,-8,-0.02,1132,0.43,-8,-0.02,0,0.0,0,0.0,1672,0.64,0,0.0
arduino:samd:mkrwan1310,0,0.0,0,0.0,1028,0.39,-8,-0.02,1136,0.43,-8,-0.02,0,0.0,0,0.0,1664,0.63,0,0.0

@github-actions
Copy link

Memory usage change @ ca0bd8b

Board flash % RAM for global variables %
arduino:mbed_portenta:envie_m4 🔺 0 - +1272 0.0 - +0.12 💚 -8 - 0 -0.0 - 0.0
arduino:mbed_portenta:envie_m7 🔺 0 - +1688 0.0 - +0.21 💚 -8 - 0 -0.0 - 0.0
arduino:samd:mkrwan1300 🔺 0 - +17156 0.0 - +6.54 💚 -8 - 0 -0.02 - 0.0
arduino:samd:mkrwan1310 🔺 0 - +17156 0.0 - +6.54 💚 -8 - 0 -0.02 - 0.0
Click for full report table
Board examples/DumbModemLoraSender
flash
% examples/DumbModemLoraSender
RAM for global variables
% examples/FirstConfiguration
flash
% examples/FirstConfiguration
RAM for global variables
% examples/LoraSendAndReceive
flash
% examples/LoraSendAndReceive
RAM for global variables
% examples/FWUpdaterBridge
flash
% examples/FWUpdaterBridge
RAM for global variables
% examples/MKRWANFWUpdate_standalone
flash
% examples/MKRWANFWUpdate_standalone
RAM for global variables
%
arduino:mbed_portenta:envie_m4 0 0.0 0 0.0 1200 0.11 -8 -0.0 1272 0.12 -8 -0.0
arduino:mbed_portenta:envie_m7 0 0.0 0 0.0 1192 0.15 -8 -0.0 1328 0.17 -8 -0.0 0 0.0 0 0.0 1688 0.21 0 0.0
arduino:samd:mkrwan1300 0 0.0 0 0.0 17044 6.5 -8 -0.02 17156 6.54 -8 -0.02 0 0.0 0 0.0 1680 0.64 0 0.0
arduino:samd:mkrwan1310 0 0.0 0 0.0 17044 6.5 -8 -0.02 17156 6.54 -8 -0.02 0 0.0 0 0.0 1672 0.64 0 0.0
Click for full report CSV
Board,examples/DumbModemLoraSender<br>flash,%,examples/DumbModemLoraSender<br>RAM for global variables,%,examples/FirstConfiguration<br>flash,%,examples/FirstConfiguration<br>RAM for global variables,%,examples/LoraSendAndReceive<br>flash,%,examples/LoraSendAndReceive<br>RAM for global variables,%,examples/FWUpdaterBridge<br>flash,%,examples/FWUpdaterBridge<br>RAM for global variables,%,examples/MKRWANFWUpdate_standalone<br>flash,%,examples/MKRWANFWUpdate_standalone<br>RAM for global variables,%
arduino:mbed_portenta:envie_m4,0,0.0,0,0.0,1200,0.11,-8,-0.0,1272,0.12,-8,-0.0
arduino:mbed_portenta:envie_m7,0,0.0,0,0.0,1192,0.15,-8,-0.0,1328,0.17,-8,-0.0,0,0.0,0,0.0,1688,0.21,0,0.0
arduino:samd:mkrwan1300,0,0.0,0,0.0,17044,6.5,-8,-0.02,17156,6.54,-8,-0.02,0,0.0,0,0.0,1680,0.64,0,0.0
arduino:samd:mkrwan1310,0,0.0,0,0.0,17044,6.5,-8,-0.02,17156,6.54,-8,-0.02,0,0.0,0,0.0,1672,0.64,0,0.0

@github-actions
Copy link

Memory usage change @ 7eae6c3

Board flash % RAM for global variables %
arduino:mbed_portenta:envie_m4 🔺 0 - +1216 0.0 - +0.12 💚 -8 - 0 -0.0 - 0.0
arduino:mbed_portenta:envie_m7 🔺 0 - +1920 0.0 - +0.24 💚 -8 - 0 -0.0 - 0.0
arduino:samd:mkrwan1300 🔺 0 - +1864 0.0 - +0.71 💚 -8 - 0 -0.02 - 0.0
arduino:samd:mkrwan1310 🔺 0 - +1856 0.0 - +0.71 💚 -8 - 0 -0.02 - 0.0
Click for full report table
Board examples/DumbModemLoraSender
flash
% examples/DumbModemLoraSender
RAM for global variables
% examples/FirstConfiguration
flash
% examples/FirstConfiguration
RAM for global variables
% examples/LoraSendAndReceive
flash
% examples/LoraSendAndReceive
RAM for global variables
% examples/FWUpdaterBridge
flash
% examples/FWUpdaterBridge
RAM for global variables
% examples/MKRWANFWUpdate_standalone
flash
% examples/MKRWANFWUpdate_standalone
RAM for global variables
%
arduino:mbed_portenta:envie_m4 0 0.0 0 0.0 1144 0.11 -8 -0.0 1216 0.12 -8 -0.0
arduino:mbed_portenta:envie_m7 0 0.0 0 0.0 1144 0.15 -8 -0.0 1280 0.16 -8 -0.0 0 0.0 0 0.0 1920 0.24 0 0.0
arduino:samd:mkrwan1300 0 0.0 0 0.0 1168 0.45 -8 -0.02 1272 0.49 -8 -0.02 0 0.0 0 0.0 1864 0.71 0 0.0
arduino:samd:mkrwan1310 0 0.0 0 0.0 1168 0.45 -8 -0.02 1276 0.49 -8 -0.02 0 0.0 0 0.0 1856 0.71 0 0.0
Click for full report CSV
Board,examples/DumbModemLoraSender<br>flash,%,examples/DumbModemLoraSender<br>RAM for global variables,%,examples/FirstConfiguration<br>flash,%,examples/FirstConfiguration<br>RAM for global variables,%,examples/LoraSendAndReceive<br>flash,%,examples/LoraSendAndReceive<br>RAM for global variables,%,examples/FWUpdaterBridge<br>flash,%,examples/FWUpdaterBridge<br>RAM for global variables,%,examples/MKRWANFWUpdate_standalone<br>flash,%,examples/MKRWANFWUpdate_standalone<br>RAM for global variables,%
arduino:mbed_portenta:envie_m4,0,0.0,0,0.0,1144,0.11,-8,-0.0,1216,0.12,-8,-0.0
arduino:mbed_portenta:envie_m7,0,0.0,0,0.0,1144,0.15,-8,-0.0,1280,0.16,-8,-0.0,0,0.0,0,0.0,1920,0.24,0,0.0
arduino:samd:mkrwan1300,0,0.0,0,0.0,1168,0.45,-8,-0.02,1272,0.49,-8,-0.02,0,0.0,0,0.0,1864,0.71,0,0.0
arduino:samd:mkrwan1310,0,0.0,0,0.0,1168,0.45,-8,-0.02,1276,0.49,-8,-0.02,0,0.0,0,0.0,1856,0.71,0,0.0

@flhofer
Copy link
Author

flhofer commented Aug 24, 2021

Finished tests, think I'm done here. Anything else?

@github-actions
Copy link

Memory usage change @ 430e02c

Board flash % RAM for global variables %
arduino:mbed_portenta:envie_m4 🔺 0 - +1280 0.0 - +0.12 💚 -8 - 0 -0.0 - 0.0
arduino:mbed_portenta:envie_m7 🔺 0 - +1912 0.0 - +0.24 💚 -8 - 0 -0.0 - 0.0
arduino:samd:mkrwan1300 🔺 0 - +1856 0.0 - +0.71 💚 -8 - 0 -0.02 - 0.0
arduino:samd:mkrwan1310 🔺 0 - +1856 0.0 - +0.71 💚 -8 - 0 -0.02 - 0.0
Click for full report table
Board examples/DumbModemLoraSender
flash
% examples/DumbModemLoraSender
RAM for global variables
% examples/FirstConfiguration
flash
% examples/FirstConfiguration
RAM for global variables
% examples/LoraSendAndReceive
flash
% examples/LoraSendAndReceive
RAM for global variables
% examples/FWUpdaterBridge
flash
% examples/FWUpdaterBridge
RAM for global variables
% examples/MKRWANFWUpdate_standalone
flash
% examples/MKRWANFWUpdate_standalone
RAM for global variables
%
arduino:mbed_portenta:envie_m4 0 0.0 0 0.0 1144 0.11 -8 -0.0 1280 0.12 -8 -0.0
arduino:mbed_portenta:envie_m7 0 0.0 0 0.0 1208 0.15 -8 -0.0 1280 0.16 -8 -0.0 0 0.0 0 0.0 1912 0.24 0 0.0
arduino:samd:mkrwan1300 0 0.0 0 0.0 1168 0.45 -8 -0.02 1272 0.49 -8 -0.02 0 0.0 0 0.0 1856 0.71 0 0.0
arduino:samd:mkrwan1310 0 0.0 0 0.0 1168 0.45 -8 -0.02 1276 0.49 -8 -0.02 0 0.0 0 0.0 1856 0.71 0 0.0
Click for full report CSV
Board,examples/DumbModemLoraSender<br>flash,%,examples/DumbModemLoraSender<br>RAM for global variables,%,examples/FirstConfiguration<br>flash,%,examples/FirstConfiguration<br>RAM for global variables,%,examples/LoraSendAndReceive<br>flash,%,examples/LoraSendAndReceive<br>RAM for global variables,%,examples/FWUpdaterBridge<br>flash,%,examples/FWUpdaterBridge<br>RAM for global variables,%,examples/MKRWANFWUpdate_standalone<br>flash,%,examples/MKRWANFWUpdate_standalone<br>RAM for global variables,%
arduino:mbed_portenta:envie_m4,0,0.0,0,0.0,1144,0.11,-8,-0.0,1280,0.12,-8,-0.0
arduino:mbed_portenta:envie_m7,0,0.0,0,0.0,1208,0.15,-8,-0.0,1280,0.16,-8,-0.0,0,0.0,0,0.0,1912,0.24,0,0.0
arduino:samd:mkrwan1300,0,0.0,0,0.0,1168,0.45,-8,-0.02,1272,0.49,-8,-0.02,0,0.0,0,0.0,1856,0.71,0,0.0
arduino:samd:mkrwan1310,0,0.0,0,0.0,1168,0.45,-8,-0.02,1276,0.49,-8,-0.02,0,0.0,0,0.0,1856,0.71,0,0.0

@github-actions
Copy link

github-actions bot commented Dec 5, 2021

Memory usage change @ 05491ef

Board flash % RAM for global variables %
arduino:mbed_portenta:envie_m4 🔺 0 - +1280 0.0 - +0.12 💚 -8 - 0 -0.0 - 0.0
arduino:mbed_portenta:envie_m7 🔺 0 - +1912 0.0 - +0.24 💚 -8 - 0 -0.0 - 0.0
arduino:samd:mkrwan1300 🔺 0 - +1872 0.0 - +0.71 💚 -8 - 0 -0.02 - 0.0
arduino:samd:mkrwan1310 🔺 0 - +1872 0.0 - +0.71 💚 -8 - 0 -0.02 - 0.0
Click for full report table
Board examples/DumbModemLoraSender
flash
% examples/DumbModemLoraSender
RAM for global variables
% examples/FirstConfiguration
flash
% examples/FirstConfiguration
RAM for global variables
% examples/LoraSendAndReceive
flash
% examples/LoraSendAndReceive
RAM for global variables
% examples/FWUpdaterBridge
flash
% examples/FWUpdaterBridge
RAM for global variables
% examples/MKRWANFWUpdate_standalone
flash
% examples/MKRWANFWUpdate_standalone
RAM for global variables
%
arduino:mbed_portenta:envie_m4 0 0.0 0 0.0 1144 0.11 -8 -0.0 1280 0.12 -8 -0.0
arduino:mbed_portenta:envie_m7 0 0.0 0 0.0 1208 0.15 -8 -0.0 1280 0.16 -8 -0.0 0 0.0 0 0.0 1912 0.24 0 0.0
arduino:samd:mkrwan1300 0 0.0 0 0.0 1184 0.45 -8 -0.02 1288 0.49 -8 -0.02 0 0.0 0 0.0 1872 0.71 0 0.0
arduino:samd:mkrwan1310 0 0.0 0 0.0 1184 0.45 -8 -0.02 1292 0.49 -8 -0.02 0 0.0 0 0.0 1872 0.71 0 0.0
Click for full report CSV
Board,examples/DumbModemLoraSender<br>flash,%,examples/DumbModemLoraSender<br>RAM for global variables,%,examples/FirstConfiguration<br>flash,%,examples/FirstConfiguration<br>RAM for global variables,%,examples/LoraSendAndReceive<br>flash,%,examples/LoraSendAndReceive<br>RAM for global variables,%,examples/FWUpdaterBridge<br>flash,%,examples/FWUpdaterBridge<br>RAM for global variables,%,examples/MKRWANFWUpdate_standalone<br>flash,%,examples/MKRWANFWUpdate_standalone<br>RAM for global variables,%
arduino:mbed_portenta:envie_m4,0,0.0,0,0.0,1144,0.11,-8,-0.0,1280,0.12,-8,-0.0
arduino:mbed_portenta:envie_m7,0,0.0,0,0.0,1208,0.15,-8,-0.0,1280,0.16,-8,-0.0,0,0.0,0,0.0,1912,0.24,0,0.0
arduino:samd:mkrwan1300,0,0.0,0,0.0,1184,0.45,-8,-0.02,1288,0.49,-8,-0.02,0,0.0,0,0.0,1872,0.71,0,0.0
arduino:samd:mkrwan1310,0,0.0,0,0.0,1184,0.45,-8,-0.02,1292,0.49,-8,-0.02,0,0.0,0,0.0,1872,0.71,0,0.0

@flhofer
Copy link
Author

flhofer commented Jan 31, 2022

@sslupsky anyone reviewing this? would solve a lot of open issues 😃

@per1234 per1234 linked an issue Feb 1, 2022 that may be closed by this pull request
@nextstep79
Copy link

@sslupsky anyone reviewing this? would solve a lot of open issues 😃

Agree - looking forward to this being merged 👍

@flhofer
Copy link
Author

flhofer commented Apr 11, 2022

guys?
@giulcioffi @sslupsky @sebromero

@flhofer
Copy link
Author

flhofer commented May 19, 2022

guys?
@giulcioffi @sslupsky @sebromero

Ping?

@larshavstad
Copy link

This PR fixes a lot of issues with the current master (v1.2.3), but it unfortunately seems to have introduced another.

I'm not able to send binary data, or at least send it correctly (it works on master). For example, sending a package with 3 bytes [0,1,255] (0x00, 0x01, 0xFF) returns -7 (LORA_ERROR_RX). I have tried using modem.write() and modem.print(). modem.write() only works with single char/byte/int etc. and not for arrays. Trying to call modem.write() more than once give the same error -7. The only way i was able to send the binary data was with modem.print() and the formanBin flag set to true, but the formatting doubles the package size. Looking into the modemSend() code I have found the issue, every HEX (4 bits) is using 8 bits (1 byte) of TX buffer. The endPackage() returns the correct number of bytes, but the received package in the network server shows the double amount of bytes. I looks like this is a firmware bug, since I have not been able to fix this in the MKRWAN.h code.

For my applications this is a big deal since I need to send as much data as possible as often as possible.
I would love to use this branch, but until this is fixed I'm forced to use master with the issues it has.

@flhofer
Copy link
Author

flhofer commented Oct 21, 2022

@Larshand92
Hi Lars. Thanks for the heads up. Are you using the matching firmware version or the 1.2.3 default? I had to fix a lot of stuff in the firmware as well to make binary send work. Before the changes, binary did not work at all.

This could explain your data doubling at the network server. You have double the data because to tx binary we have to translate bytes to ascii, i.e., we take the hex value and translate it to two ascii chars, to send it over the serial terminal to the lora modem. The modem firmware has then to translate it back. It seems that in your case the firmware is not doing that.

Can you follow up on this?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Allow printing the RSSI values
7 participants