|
|
@@ -196,9 +196,20 @@ file for the VCP that runs on the gateway. In my case, the device |
|
|
|
name is `/dev/cu.usbmodem1451` as I am on my MacBook Pro, so the command |
|
|
|
to launch the gateway is simply: |
|
|
|
``` |
|
|
|
python loraserv.py /dev/cu.usbmodem1451 |
|
|
|
python3 loraserv.py /dev/cu.usbmodem1451 |
|
|
|
``` |
|
|
|
|
|
|
|
Note: On FreeBSD, the default open mode echos characters back to the |
|
|
|
gateway causing it not to work. It is advised to setup the modem tty |
|
|
|
via the command: |
|
|
|
``` |
|
|
|
stty -f /dev/cuaU0.init gfmt1:cflag=cb00:iflag=2e02:lflag=43:oflag=2:discard=f:dsusp=19:eof=4:eol=ff:eol2=ff:erase=7f:erase2=8:intr=3:kill=15:lnext=16:min=1:quit=1c:reprint=12:start=11:status=14:stop=13:susp=1a:time=0:werase=17:ispeed=9600:ospeed=9600 |
|
|
|
``` |
|
|
|
before running the `loraserv.py` command. Replace `/dev/cuaU0.init` |
|
|
|
with the respective device. The above was generated by running |
|
|
|
`cu -l /dev/cuaU0` in one terminal, while obtaining the info via |
|
|
|
`stty -g -f /dev/cuaU0` in another terminal. |
|
|
|
|
|
|
|
Once that is running, then the `lora.py` program's multicast packets |
|
|
|
will be forwarded out via the LoRa radio. |
|
|
|
|
|
|
@@ -206,12 +217,12 @@ To test it, a simple `ping` command can be used, or turning on or off |
|
|
|
the on board LED via channel 4 using the `setunset` command. The ping |
|
|
|
command: |
|
|
|
``` |
|
|
|
python lora.py -s <sharedkey> ping |
|
|
|
python3 lora.py -s <sharedkey> ping |
|
|
|
``` |
|
|
|
|
|
|
|
To turn off the LED (which defaults to on): |
|
|
|
``` |
|
|
|
python lora.py -s <sharedkey> setunset 4 0 |
|
|
|
python3 lora.py -s <sharedkey> setunset 4 0 |
|
|
|
``` |
|
|
|
|
|
|
|
Either of these commands should exit w/o message or error. |
|
|
@@ -219,7 +230,7 @@ Either of these commands should exit w/o message or error. |
|
|
|
Multiple commands may be specified by separating them w/ `--` (two |
|
|
|
hyphens). For example: |
|
|
|
``` |
|
|
|
python lora.py -s <sharedkey> -- setunset 4 0 -- setunset 1 1 |
|
|
|
python3 lora.py -s <sharedkey> -- setunset 4 0 -- setunset 1 1 |
|
|
|
``` |
|
|
|
|
|
|
|
The first `--` is required to denote the end of option parsing, |
|
|
@@ -269,4 +280,14 @@ command. The available commands are: |
|
|
|
* `waitfor`: Wait for the specified time before advancing to the next |
|
|
|
enqueued command. |
|
|
|
|
|
|
|
Notes |
|
|
|
----- |
|
|
|
|
|
|
|
Significant portions of this code is copied from various reference |
|
|
|
implementations. Basic review shows that it is of questionable quality. |
|
|
|
It would be good to fully review all the code under stm32 and loramac |
|
|
|
for any bugs and other issues. The buffer handling has already been |
|
|
|
improved, but there is still plety of work that can be done to improve |
|
|
|
it further. |
|
|
|
|
|
|
|
<!-- Markdeep: --><style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace}</style><script src="markdeep.min.js" charset="utf-8"></script><script src="https://casual-effects.com/markdeep/latest/markdeep.min.js" charset="utf-8"></script><script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script> |