Hey all,
I have a heltec v3 and a raspberry pi and im looking to see how i can use my rpi to interface with the heltec device via bluetooth. Anyone have experience doing this? Id like to potentially have a web gui but also interested in using the python package to send messages based on some events ill be creating.
Is there a specific reason why you are choosing Bluetooth instead of WiFi? Connecting the Heltec V3 to the local WiFi will let you interact with it over the network. I think that this would make what you want to do a lot easier.
The Heltec V3 device itself can connect to wifi? I must have been living under a rock. Can you point me to where I can do this?
I don’t have the Heltec V3, but the model I was able to find online does support WiFi.
You need to connect to it using some other device. It can be with Bluetooth using an app, or via USB using a web client. Once you are connected to it, you can go to Radio Configuration and add the WiFi info in the Network settings.
Then, you need to figure out what its IP is. There are a few different ways to do it. Usually I log into my router and check the IP of the latest device to log into the WiFi.
You can then go to that IP via your browser, and you will see this:
You can then connect to it and interact with the device over the browser.
To interact with it using the python library, you set the device’s IP as the NODE’s interface. Here is an example of a very simple script that will connect to the node via its IP and cause it to automatically respond with ‘Pong’ to any message that it receives that contain ‘Ping’.
import meshtastic import meshtastic.tcp_interface from pubsub import pub import time # Your Meshtastic node's IP MESHTASTIC_NODE_IP = "192.168.8.149" def onReceive(packet, interface): if 'decoded' in packet and 'payload' in packet['decoded']: try: message = packet['decoded']['payload'].decode('utf-8') sender = packet['from'] if "Ping" in message: interface.sendText("Pong", destinationId=sender) except Exception as e: pass interface = meshtastic.tcp_interface.TCPInterface(hostname=MESHTASTIC_NODE_IP) pub.subscribe(onReceive, "meshtastic.receive") while True: time.sleep(5) # Keep the script running
Hijacking a bit… I’m on the hunt for a meshtastic device with Ethernet instead of WiFi. Having a hard time finding specifics about what options there are.
You seem like a person in the know. Any suggestions?
Checkout the Femtofox, it’s a Luckfox pico running full Linux with a 1W LoRa module, and it happens to have the Ethernet port built in. Really neat bit of open source kit.
EDIT: I looked more into the ethernet + RAK boards. I was surprised to find claims that the boards that make use of the Nordic nRF microcontroller do not expose an interface for receiving commands nor do they expose a Webserver. It seems they can push data to the MQTT broker, but it might not possible to control them over the network. Here is a short discussion I found about this: https://www.reddit.com/r/meshtastic/comments/1ebcnay/rak_board_ethernet_non_web_client_access
I can’t find evidence to support that it works today. I know that ESP32-based meshtastic devices do expose the webserver and the TCP interface. But I am not sure about how to add the ethernet interface.
original comment
Simplest option would probably be to make use of the RAK system. They provide modular boards for Meshtastic, and one of modules is an Ethernet interface: https://docs.rakwireless.com/product-categories/wisblock/rak13800/datasheet/
The WisMesh Ethernet MQTT gateway is an example of an assembled module that uses the RAK19007 WisBlock Baseboard as the base that includes the power management and the slots for attaching the modules, the RAK4631 LoRa transciever module to provide the radio, and the RAK13800 Ethernet Module to provide Ethernet connectivity.
The version that does not include an enclosure and has no Power-Over-Ethernet costs $43 through RAK. You can also get the versions with enclosure and with PoE. For PoE, you will need to have an ethernet modem/router capable of providing power over ethernet or a PoE ethernet switch.
I don’t know much about the other Ethernet options, but there is a good chance that a good amount of them will consist of a custom 3D-printed enclosure with the RAK system inside.
Another option is to use a Raspberry Pi or a regular computer as a bridge. The computer/raspberry pi connects to the network over ethernet and interfaces with a standard Meshtastic device via USB or via a HAT using the PI’s GPIO pins (example of the HAT: https://www.youtube.com/watch?v=91ULi9DWgds).
I have edited my original comment with important corrections. Commenting again so that you don’t miss them.
Yeah web is easiest. Second is the python library.
I have a script that every day at 6 gets the local weather and posts about it. It’s been working for about half a year now. Works well.
In the radio settings you can setup the wifi network that you want to use.
If they are going to be sitting close to each other, consider using a USB cable between them and communicating via serial. This is more reliable than Bluetooth/WiFi and it’s one less power supply to worry about.
Probably the Python library would be the easiest place to get started.
https://meshtastic.org/docs/development/python/library/
I haven’t worked with it for a few months, but the documentation at least was pretty sparse. Despite that, it’s simple enough to follow the code.