meshtastic / framework-portduino

An Arduino API that sits on top of Linux and other operating systems. This lets you run Arduino code on Raspberry PI, desktops, etc... All as a standard user-space application.
GNU Lesser General Public License v2.1
22 stars 11 forks source link

I2C Support: Custom Addressing for Meshtastic #15

Closed daiceman825 closed 3 months ago

daiceman825 commented 4 months ago

Hello, I was referred here from the geeksville portduino thread where I asked about I2C support.

Is it possible to set custom I2C addresses for Meshtastic to use so that the Adafruit LoRa RFM95W can be used with Meshtastic? The Adafruit bonnet is on a Raspberry Pi Zero 2 W.

I tried working on a project that implemented this a couple years ago and stopped because the original portduino from geeksville didnt support setting custom i2c addresses (or at least I couldn't figure it out). The issue that I was experiencing was that on the Adafruit bonnet, the oled screen uses the address that Meshtastic tries to access for the LoRa radio. In the other thread GUVWAF mentioned that this had been accomplished, so I would like to know how to get it working.

Thank you!

jp-bennett commented 4 months ago

Hey, so the interesting thing about I2C is that the host doesn't have a dedicated address. We do have support for that device in Meshtastic, with both the radio and the display working. I'm reasonably certain that only the display is connected with I2C, while the radio is SPI and a couple GPIO pins. I'd suggest looking at Meshtastic code for inspiration on how to get this working.