opencom_xl_firmware/README.md

151 lines
8.3 KiB
Markdown
Raw Normal View History

2022-11-01 23:06:39 +01:00
# RNode Firmware <img align="right" src="https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg"/>
2018-04-05 18:15:25 +02:00
2018-06-20 22:08:28 +02:00
This is the firmware for [RNode](https://unsigned.io/rnode), a very flexible LoRa-based communication device. RNode can functions as a:
2018-04-05 18:15:25 +02:00
2022-02-22 14:07:18 +01:00
- Network adapter for [Reticulum](https://github.com/markqvist/Reticulum)
2022-11-03 00:06:08 +01:00
- A general purpose long-range data radio
2018-06-20 21:30:36 +02:00
- LoRa interface for your computer (or any device with a USB or serial port)
2018-07-01 19:22:36 +02:00
- Generic [LoRa-based network adapter](https://unsigned.io/15-kilometre-ssh-link-with-rnode/) for your Linux devices
2018-06-27 14:53:27 +02:00
- [Packet sniffer](https://github.com/markqvist/LoRaMon) for LoRa networks
2018-06-20 21:30:36 +02:00
- LoRa development board
2022-02-22 14:07:18 +01:00
- A LoRa-based KISS-compatible TNC for amateur radio and AX.25 applications
2018-06-20 21:30:36 +02:00
- A flexible platform for experiementing with LoRa technology
2018-04-05 18:15:25 +02:00
2022-01-28 00:42:13 +01:00
To install this firmware on homebrew RNodes and other supported boards, please use the [RNode Config Utility](https://github.com/markqvist/rnodeconfigutil). It contains an auto-installer that allows you to install the RNode firmware on a variety of boards. For guides and tutorials on how to get started with making your own RNodes, visit [unsigned.io](https://unsigned.io).
2022-01-19 22:18:09 +01:00
2022-11-02 23:12:39 +01:00
![Devices Running RNode Firmware](https://github.com/markqvist/RNode_Firmware/raw/master/Documentation/rnfw_1.jpg)
2022-11-01 23:22:32 +01:00
## Get Started
You can download and flash the firmware to all the supported boards using the [RNode Config Utility](https://github.com/markqvist/rnodeconfigutil). All firmware releases are now handled and installed directly through the `rnodeconf` utility, which is inclueded in the `rns` package. It can be installed via `pip`:
```
# Install rnodeconf via rns package
pip install rns --upgrade
# Install the firmware on a board with the install guide
rnodeconf --autoinstall
```
2022-02-22 14:07:18 +01:00
## Current Status
The RNode firmware can be considered stable at this point. If you do find a bug or discover unintended behaviour, please report it as an issue here, so I can fix it!
## Supported Hardware
2022-01-28 00:51:44 +01:00
The RNode Firmware supports the following boards:
- The original RNode from [unsigned.io](https://unsigned.io/)
- Homebrew RNodes based on ATmega1284p boards
- Homebrew RNodes based on ATmega2560 boards
- Homebrew RNodes based on Adafruit Feather ESP32 boards
- Homebrew RNodes based on generic ESP32 boards
- LilyGO T-Beam v1.1 devices
- LilyGO LoRa32 v2.0 devices
- LilyGO LoRa32 v2.1 devices
2022-06-16 19:26:23 +02:00
- Heltec LoRa32 v2 devices
2022-01-28 00:51:44 +01:00
2022-01-28 00:42:13 +01:00
The original RNode from [unsigned.io](https://unsigned.io) is controlled by a powerful ATmega1284p MCU, and is fully Arduino compatible. You can use this firmware, or it can be programmed any way you like, either from the Arduino IDE, or using any of the available tools for AVR development. This firmware can also be edited and compiled directly from the Arduino IDE.
2018-06-20 21:30:36 +02:00
2018-06-20 21:58:35 +02:00
For adding RNode to your Arduino environment, please see [this post](https://unsigned.io/board-support-in-arduino-ide/).
2018-06-20 21:30:36 +02:00
For configuring an RNode with this firmware, please have a look at the [RNode Config Utility](https://github.com/markqvist/rnodeconfigutil).
2018-04-05 18:15:25 +02:00
2018-06-20 21:58:35 +02:00
## Operating Modes
RNode can operate in two modes, host-controlled (default) and TNC mode:
- When RNode is in host-controlled mode, it will stay in standby when powered on, until the host specifies frequency, bandwidth, transmit power and other required parameters. This mode can be enabled by using the -N option of this utility. In host-controlled mode, promiscuous mode can be activated to sniff any LoRa frames.
- When RNode is in TNC mode, it will configure itself on powerup and enable the radio immediately. This mode can be enabled by using the -T option of this utility (the utility will guide you through the settings if you don't specify them directly).
## USB and Serial Protocol
You can communicate with RNode either via the on-board USB connector, or using the serial pins on the board (labeled RX0 and TX0). RNode uses a standard FTDI USB chip, so it works out of the box without additional drivers in most operating systems.
2018-06-20 22:01:24 +02:00
All communications to and from the board uses [KISS framing](https://en.wikipedia.org/wiki/KISS_(TNC)) with a custom command set. RNode also does not use HDLC ports in the command byte, and as such uses the full 8 bits of the command byte is available for the actual command. Please see table below for supported commands.
2018-06-20 21:58:35 +02:00
| Command | Byte | Description
| -----------------|------| -----------------------------------------------
| Data frame | 0x00 | A data packet to or from the device
| Frequency | 0x01 | Sets or queries the frequency
| Bandwidth | 0x02 | Sets or queries the bandwidth
| TX Power | 0x03 | Sets or queries the TX power
| Spreading Factor | 0x04 | Sets or queries the spreading factor
| Coding Rate | 0x05 | Sets or queries the coding rate
| Radio State | 0x06 | Sets or queries radio state
| Radio Lock | 0x07 | Sets or queries the radio lock
| Device Detect | 0x08 | Probe command for device detection
| Promiscuous | 0x0E | Sets or queries promiscuous mode
| RX Stats | 0x21 | Queries received bytes
| TX Stats | 0x22 | Queries transmitted bytes
| Last RSSI | 0x23 | Indicates RSSI of last packet received
| Blink | 0x30 | Blinks LEDs
| Random | 0x40 | Queries for a random number
| Firmware Version | 0x50 | Queries for installed firmware version
| ROM Read | 0x51 | Read EEPROM byte
| ROM Write | 0x52 | Write EEPROM byte
| TNC Mode | 0x53 | Enables TNC mode
| Normal Mode | 0x54 | Enables host-controlled mode
| ROM Erase | 0x59 | Completely erases EEPROM
| Error | 0x90 | Indicates an error
2018-06-22 10:23:09 +02:00
## Programming Libraries
Have a look in the "Libraries" folder for includes to let you easily use RNode in your own software.
Here's a Python example:
2018-06-22 10:19:53 +02:00
```python
2018-06-22 11:17:14 +02:00
from RNode import RNodeInterface
2018-06-22 10:19:53 +02:00
def gotPacket(data, rnode):
print "Received a packet: "+data
rnode = RNodeInterface(
callback = gotPacket,
name = "My RNode",
port = "/dev/ttyUSB0",
frequency = 868000000,
bandwidth = 125000,
txpower = 2,
sf = 7,
cr = 5,
2018-06-22 11:17:14 +02:00
loglevel = RNodeInterface.LOG_DEBUG)
2018-06-22 10:19:53 +02:00
rnode.send("Hello World!")
```
2018-06-27 11:50:27 +02:00
2018-06-27 11:51:57 +02:00
## Promiscuous Mode and LoRa Sniffing
2021-10-11 15:28:27 +02:00
RNode can be put into LoRa promiscuous mode, which will dump raw LoRa frames to the host. Raw LoRa frames can also be sent in this mode, and have the standard LoRa payload size of 255 bytes. To enable promiscuous mode send the "Promiscuous" command to the board, or use one of the programming libraries. You can also use the example program [LoRaMon](https://github.com/markqvist/LoRaMon) for an easy to use LoRa packet sniffer.
## Support RNode Development
You can help support the continued development of open, free and private communications systems by donating via one of the following channels:
2022-11-01 23:35:23 +01:00
- Monero:
```
84FpY1QbxHcgdseePYNmhTHcrgMX4nFfBYtz2GKYToqHVVhJp8Eaw1Z1EedRnKD19b3B8NiLCGVxzKV17UMmmeEsCrPyA5w
```
- Ethereum
```
0x81F7B979fEa6134bA9FD5c701b3501A2e61E897a
```
- Bitcoin
```
3CPmacGm34qYvR6XWLVEJmi2aNe3PZqUuq
```
2021-10-11 15:28:27 +02:00
- Ko-Fi: https://ko-fi.com/markqvist
2022-11-01 23:06:39 +01:00
## License
2022-11-02 23:05:09 +01:00
Permission is hereby granted to use the RNode firmware in binary form, for any and all purposes, and to freely distribute binary copies of the firmware, so long as no payment or compensation is charged or received for such distribution or use.
If you want to charge money or receive compensation for providing this work to others, in any way or form, you must buy a license for doing so, which is cheap and easy.
2022-11-01 23:06:39 +01:00
Unless otherwise noted, this work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].
Prior versions of this work, until and including commit [fe5e6aab9c2ab8fe69ede7f1da04bcffff7d1ed7](https://github.com/markqvist/RNode_Firmware/commit/fe5e6aab9c2ab8fe69ede7f1da04bcffff7d1ed7) was licensed purely under MIT License.
2022-11-02 23:05:09 +01:00
If you want to use the RNode Firmware in commercial products, or build and sell RNodes, it is easy to do so by licensing the firmware commercially. I provide a range of convenient tools and resources for anyone who wants to build and sell RNodes, so just get in contact with me to get started.
2022-11-01 23:06:39 +01:00
2022-11-01 23:34:34 +01:00
<img src="https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png" align="right">
2022-11-01 23:06:39 +01:00
[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
[cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png
[cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg