Closed BNNorman closed 3 years ago
Thanks for working on this. I'll have a look later in the week when I get some time.
I'm happy with those changes.
Glad to help. On 21/05/2021 15:01:58, Philip Basford @.***> wrote: @pjb304 requested changes on this pull request. Hi Brian, Many thanks for submitting this pull request. It looks good and behaves on my device. I've made a couple of suggestions for changes to be made. If you're happy with them I'll do the merge. Phil In README.md [https://github.com/computenodes/dragino/pull/11#discussion_r636927781]:
- Install the required packages
sudo apt install device-tree-compiler git python3-crypto python3-nmea2 python3-rpi.gpio python3-serial python3-spidev python3-configobj
5. Download the git repogit clone https://github.com/computenodes/LoRaWAN.git
+ 1. make a copy of dragingo.ini.default 'cp dragino.ini.default dragino.ini' ⬇️ Suggested change
- make a copy of dragingo.ini.default 'cp dragino.ini.default dragino.ini' + 1. make a copy of dragingo.ini.default
cp dragino.ini.default dragino.ini
In README.md [https://github.com/computenodes/dragino/pull/11#discussion_r636928078]:- Enable additional CS lines (See section below for explanation) 1. Change into the overlay directory
cd dragino/overlay
2. Compile the overlaydtc -@ -I dts -O dtb -o spi-gpio-cs.dtbo spi-gpio-cs-overlay.dts
. This might generate a couple of warnings, but seems to work ok 3. Copy the output file to the required foldersudo cp spi-gpio-cs.dtbo /boot/overlays/
4. Enable the overlay at next rebootecho "dtoverlay=spi-gpio-cs" | sudo tee -a /boot/config.txt
5. Reboot the Pisudo reboot
6. Check that the new cs lines are enabledls /dev/spidev0.*
should output/dev/spidev0.0 /dev/spidev0.1 /dev/spidev0.2
. In which case the required SPI CS line now exists -7. Create a new device in The Things Network console and copy the details into the config file +7. Create a new device in The Things Network console and copy the details into the config file dragino.ini ⬇️ Suggested change -7. Create a new device in The Things Network console and copy the details into the config file dragino.ini +7. Create a new device in The Things Network console and copy the details into the config filedragino.ini
In test_downlink.py [https://github.com/computenodes/dragino/pull/11#discussion_r636942713]: +logging.basicConfig(filename="test_downlink.log", format='%(asctime)s - %(funcName)s - %(lineno)d - %(levelname)s - %(message)s', level=logLevel) + +logging.info("Starting session") + +callbackReceived=False + +def downlinkCallback(payload,mtype): + ''' + Called by dragino.on_rx_done() when an UNCONF_DATA_DOWN or CONF_DATA_DOWN downlink message arrives. + Scheduling a CONF_DATA_DOW message requires an uplink response which + impacts on the fair use policy. Not recommended! + + payload: bytearray + mtype: one of UNCONF_DATA_DOWN or CONF_DATA_DOWN + ''' + print("downlink message received") ⬇️ Suggested change
- print("downlink message received") + global callbackReceived + callbackReceived = True + print("downlink message received") This will make it so that the program ends once the downlink has been received. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub [https://github.com/computenodes/dragino/pull/11#pullrequestreview-665476989], or unsubscribe [https://github.com/notifications/unsubscribe-auth/ADY5NXO7VGLPZWGC3RCMJPTTOZRVNANCNFSM45CRHEGA].
Please take a look at my changes. I have added a new test: test_downlink.py I have added logfile names to test.py and test_downlink.py. I have updated README.md, a bit. I have modified dragino.py to enable the capture of data down messages.
regards Brian Norman