Documentation improved, structured repo cleaner, mqtt is mostly finish

This commit is contained in:
Dionysus 2024-05-07 15:33:49 -04:00
parent b8404bcd0c
commit d33930ee37
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE
10 changed files with 99 additions and 78 deletions

View File

@ -1,41 +0,0 @@
# Hardware
## Meshtastic Devices
###### LilyGo T-Deck
This is the ONLY standalone device for Meshtastic that does not require a phone to use it!
![](.screens/tdeck.png)
- [T-Deck](https://www.lilygo.cc/products/t-deck)
- [Case](https://www.printables.com/model/741124-lilygo-t-deck-case) *(You can 3D print it yourself, or follow the Etsy link on here to buy one)*
- [Antenna](https://www.amazon.com/dp/B086ZG5WBR)
- [GPS](https://www.amazon.com/dp/B09LQDG1HY) *(There may be a better 15mm option for the case above..)*
- [Battery](https://www.amazon.com/dp/B0BG82T39Y) *(The battery you get depends on the size of the case you order, contact me if you need help)*
___
###### LilyGo T-Beam
Popular device, I personally use it for my home station
![](.screens/tbeam.png)
- [T-Beam](https://www.lilygo.cc/en-ca/products/t-beam-v1-1-esp32-lora-module?variant=43059202719925)
___
###### Heltec Lora 32 V3
Great as a keychain for on the go meshtastic! Can power it directly from your phone if you want.
![](.screens/heltec.png)
- [Heltec Lora 32 V3](https://heltec.org/project/wifi-lora-32-v3/)
___
###### WisBlock
These devices use an nrf52 chip instead of an esp32 chip. They are EXTREMELY low powered and are the best for solar nodes
![](.screens/wisblock.png)
- [WisBlock Starter Kit](https://store.rakwireless.com/products/wisblock-starter-kit?variant=41786685063366)
**Note:** Make sure you get the nrf52 Arduino core and ensure you get the right frequency for your location.

View File

@ -4,23 +4,28 @@ This repository serves as a collection of resources created in my journey to lea
The goal here is to create simple & clean modules to interface with the hardware in a way that can be used to expand the possibilities of the devices capabilities. The goal here is to create simple & clean modules to interface with the hardware in a way that can be used to expand the possibilities of the devices capabilities.
The hardware I am experimenting with: [Lilygo T-Deck](https://www.lilygo.cc/products/t-deck), [Lilygo T-Beam](https://www.lilygo.cc/products/t-beam-v1-1-esp32-lora-module), [Heltec Lora 32 v3](https://heltec.org/project/wifi-lora-32-v3/), and [RAK Wireless 4631](https://store.rakwireless.com/products/wisblock-core-modules?variant=42440631419078)
![](.screens/htpdeck.png) ![](.screens/htpdeck.png)
## Documentation ## Documentation
- [Firmware Hacks & Customization](./FIRMWARE.md) - [Hardware Options](./docs/HARDWARE.md)
- [Setup Hardware](./SETUP.md) - [Setup Hardware](./SETUP.md)
- [Setup a T-Deck](./docs/T-DECK.md)
- [Firmware Hacks & Customization](./docs/FIRMWARE.md)
- [MQTT Notes](./docs/MQTT.md)
## Code
- [Meshtastic Serial/TCP Interface](./meshapi.py)
- [Meshtastic MQTT Interface](./meshmqtt.py)
- [Meshtastic IRC Relay / Bridge](./meshirc.py)
## Bugs & Issues ## Bugs & Issues
- Devices must have Wifi turned off when going mobile. Upon leaving my house with WiFi still enabled, the UI & connection was EXTREMELY laggy & poor. Couldn't even type well... - Devices must have Wifi turned off when going mobile. Upon leaving my house with WiFi still enabled, the UI & connection was EXTREMELY laggy & poor. Couldn't even type well...
- Devices using a MQTT with TLS will reboot loop. - Devices using a MQTT with TLS will reboot loop.
- A fix for the reboot loop is simply disabling MQTT over serial with `meshtastic --set mqtt.enabled false` - A fix for the reboot loop is simply disabling MQTT over serial with `meshtastic --set mqtt.tls_enabled false`
- `event_node` event is called **AS** we are defining the interface, so using `self.interface` in that callback will error. - Enabling JSON with MQTT causes messages to not be encrypted in the MQTT server..
## Roadmap ## Roadmap
- Asyncronous meshtastic interface - Asyncronous meshtastic interface
- MQTT interface with working decryption
- Documentation on MQTT bridging for high availability - Documentation on MQTT bridging for high availability
- Bridge for IRC to allow channel messages to relay over Meshtastic & all Meshtastic events to relay into IRC. *(IRC to Meshtastic will require a command like `!mesh <message here>` to avoid overloading the traffic over LoRa)* - Bridge for IRC to allow channel messages to relay over Meshtastic & all Meshtastic events to relay into IRC. *(IRC to Meshtastic will require a command like `!mesh <message here>` to avoid overloading the traffic over LoRa)*

View File

@ -1,29 +0,0 @@
# LilyGo T-Deck Notes
![](.screens/htpdeck.png)
## Parts
- [T-Deck](https://www.lilygo.cc/products/t-deck)
- [Case](https://www.printables.com/model/741124-lilygo-t-deck-case) *(You can 3D print it yourself, or follow the Etsy link on here to buy one)*
- [Antenna](https://www.amazon.com/dp/B086ZG5WBR)
- [GPS](https://www.amazon.com/dp/B09LQDG1HY) *(There may be a better 15mm option for the case above..)*
- [Battery](https://www.amazon.com/dp/B0BG82T39Y) *(The battery you get depends on the size of the case you order, contact me if you need help)*
**WARNING:** Do not power on the device until the antenna is plugged in! Even to flash the firmware, or for testing, make sure your antenna is plugged in or you can fry the radio!
## GPS Installation
The T-Deck has a grove connector for the GPS. Personally, I do not use a grove connector for mine, I removed the Grove input and soldered directly to the board.
**WARNING**: Be careful taking off the grove! Snip the front points, and then use a soldering iron to loosen the metal on the 4 contact back points. You can VERY easily pull the solder pads right off if you just try to rip the grove connector off without loosening the solder points. If you pull off a solder pad, you're pretty much boned on having a GPS module.
![](.screens/solder_pads_lol.png)
*Above: Picture of solder pads accidentally pulled off lol...*
You will see VCC, GND, RX & TX points on both the T-Deck & the GPS. Solder wires to match these points, but switch RX & TX. So do VCC to VCC, GND to GND, and then ensure that RX is soldered to TX, and TX is soldered to RX. It's confusing, I know, but that's China based hardware for you...
## Flashing
Simply plug in the T-Deck via USB and connect to a computer, then visit the [Meshtastic Web Flasher](https://flasher.meshtastic.org) and select your hardware & firmware version. Your device should show up as a serial device on /dev/ttyUSB0 or /dev/ttyAMC0. If you do not see your device, try adding your user to the dialout group. See [SETUP.md](./SETUP.md) for information on how to setup the device once it is flashed with Meshtastic.
## Issues
- Turn off WiFi completely if you plan to use this on-the-go. The device has an ESP32 chip which will always preffer WiFi over Bluetooth, so if you leave the house with this thign, it will constantly keep trying to connect to your WiFi & really degrade the performance of the board.

View File

@ -13,6 +13,8 @@
- The data from this goes in `firmware/src/graphics/img/icon.xbm` - The data from this goes in `firmware/src/graphics/img/icon.xbm`
You can use the provided [icon.xbm](../assets/icon.xbm) for a rad GTA:SA fist to show up on boot.
###### Custom boot message ###### Custom boot message
- Navigate to `firmware/src/graphics/Screen.cpp` - Navigate to `firmware/src/graphics/Screen.cpp`

48
docs/HARDWARE.md Normal file
View File

@ -0,0 +1,48 @@
# Hardware
> A simple overview of popular hardware options for Meshtastic usage
## LilyGo T-Deck
![](.screens/tdeck.png)
###### Information
This is the only FULL stand-alone device that I know of for Meshtastic, that once provisioned, you do not need a phone or computer to interface with it. The device comes with a touchscreen, full keyboard, built in speaker, and more.
| Item | Cost | Description |
| ---- | ---- | ----------- |
| [T-Deck](https://www.lilygo.cc/products/t-deck) | $50 | The main LoRa microcontroller device |
| [Case](https://www.printables.com/model/741124-lilygo-t-deck-case) | Free or $25 | You can 3D print it yourself, or follow the Etsy link and buy one |
| [Antenna](https://www.amazon.com/Connector-868-915MHz-Lora32u4-Internet-WIshiOT/dp/B07LCKNN4H) | 14$ | External antenna for better range |
| [GPS](https://www.amazon.com/dp/B09LQDG1HY) | 18$ | There may be a better 15mm option for the case above.. |
| [Battery](https://www.amazon.com/dp/B0BG82T39Y) | Varies | The battery you get depends on the size of the case you order, contact me if you need help |
___
## LilyGo T-Beam
![](.screens/tbeam.png)
###### Information
Very popular Meshtastic device. I personally use this for my home station
| Item | Cost | Description |
| ---- | ---- | ----------- |
| [T-Beam](https://www.lilygo.cc/en-ca/products/t-beam-v1-1-esp32-lora-module?variant=43059202719925) | 32$ | The main LoRa board |
| [Case](https://www.printables.com/model/127253-t-beam-case-for-meshtastic-v5) | Free | You can maybe find this case on Etsy or 3D print it yourself |
___
## Heltec Lora 32 V3
Great as a keychain for on the go meshtastic! Can power it directly from your phone if you want.
![](.screens/heltec.png)
- [Heltec Lora 32 V3](https://heltec.org/project/wifi-lora-32-v3/)
___
## WisBlock
These devices use an nrf52 chip instead of an esp32 chip. They are EXTREMELY low powered and are the best for solar nodes
![](.screens/wisblock.png)
- [WisBlock Starter Kit](https://store.rakwireless.com/products/wisblock-starter-kit?variant=41786685063366)
**Note:** Make sure you get the nrf52 Arduino core and ensure you get the right frequency for your location.

View File

@ -1,3 +1,6 @@
# Meshtastic MQTT
> Work in progress still, come back later...
###### default.conf ###### default.conf
``` ```
# Insecure # Insecure

32
docs/T-DECK.md Normal file
View File

@ -0,0 +1,32 @@
# Meshtastic on a T-Deck
![](.screens/htpdeck.png)
## Parts
- [T-Deck](https://www.lilygo.cc/products/t-deck)
- [Case](https://www.printables.com/model/741124-lilygo-t-deck-case)
- You can 3D print it yourself, or you can buy one on Etsy from the link above.
- [Antenna](https://www.amazon.com/Connector-868-915MHz-Lora32u4-Internet-WIshiOT/dp/B07LCKNN4H)
- The T-Deck has an I-PEX connection point for antennas. I used an I-PEX-to-SMA adapter so I could screw on a little 2dbi antenna.
- [GPS]https://www.amazon.com/Teyleten-Robot-Dual-Mode-Positioning-Replacement/dp/B09LQDG1HY)
- There may be a better 15mm option for the case above...this is just what I used.
- [Battery](https://www.amazon.com/AKZYTUE-5000mAh-Battery-Rechargeable-Connector/dp/B07TXJ5XXZ/)
- The battery you get depends on the size of the case you order. Do your measurements, contact me if you need help.
## GPS Installation
The T-Deck has a grove connector for the GPS, but for using this inside of a case, I decided to remove the connector and solder the GPS directly to the board.
###### Soldering
You will see VCC, GND, RX & TX points on both the T-Deck & the GPS. Solder wires to match these points, but switch RX & TX. So do VCC to VCC, GND to GND, and then ensure that RX is soldered to TX, and TX is soldered to RX.
###### WARNING
Be careful taking off the grove! Snip the front connnection points and then use a soldering iron to loosen the metal on the 4 back side connection points. You can VERY easily pull the solder pads right off if you just try to rip the grove connector off without loosening the solder points. If you pull off a solder pad, you're pretty much boned on having a GPS module. This has happened to ALOT of people with these things.
![](.screens/solder_pads_lol.png)
*Above: Picture of solder pads accidentally pulled off lol...*
## Flashing
###### **WARNING:** Do not power on the device until the antenna is plugged in! Even to flash the firmware, or for testing, make sure your antenna is plugged in or you can fry the radio!
Simply plug in the T-Deck via USB and connect to a computer, then visit the [Meshtastic Web Flasher](https://flasher.meshtastic.org) and select your hardware & firmware version. Your device should show up as a serial device on /dev/ttyUSB0 or /dev/ttyAMC0. If you do not see your device, try adding your user to the dialout group. See [SETUP.md](./SETUP.md) for information on how to setup the device once it is flashed with Meshtastic.

View File

@ -209,8 +209,9 @@ if __name__ == '__main__':
# Enable TLS/SSL if the --tls flag is set # Enable TLS/SSL if the --tls flag is set
if args.tls: if args.tls:
import ssl import ssl
client.tls_set(cert_reqs=ssl.CERT_REQUIRED, tls_version=ssl.PROTOCOL_TLSv1_2) client.tls_set()
client.tls_insecure_set(False) #client.tls_set(cert_reqs=ssl.CERT_REQUIRED, tls_version=ssl.PROTOCOL_TLSv1_2)
#client.tls_insecure_set(False)
# Set the callbacks # Set the callbacks
client.on_connect = on_connect client.on_connect = on_connect