Hey there,
I am trying to slightly modify the existing firmware for my T-beamV1.1 so that a node can read an ADC pin and send its value over the mesh. I know that we can use the serial module to read sensor data but I find that using an external MCU to just read an ADC pin is wasting a lot of power.
On the serial monitor, I can see that my node is trying to send the message but it is not being shown on the screen of my receiver. This is a relevant piece of the serial log of the transmitter.
DEBUG | ??:??:?? 14 Moisture reading is 303
DEBUG | ??:??:?? 14 Msg from=0x55c6a2a0, id=0x5412efc9, msg=/
DEBUG | ??:??:?? 14 Update DB node 0x55c6a2a0, rx_time=0, channel=0
DEBUG | ??:??:?? 14 handleReceived(LOCAL) (id=0x5412efc9 fr=0xa0 to=0xff, WantAck=0, HopLim=3 Ch=0x0 Portnum=0)
DEBUG | ??:??:?? 14 No modules interested in portnum=0, src=LOCAL
DEBUG | ??:??:?? 14 localSend to channel 0
DEBUG | ??:??:?? 14 Add packet record (id=0x5412efc9 fr=0xa0 to=0xff, WantAck=0, HopLim=3 Ch=0x0 Portnum=0)
DEBUG | ??:??:?? 14 Expanding short PSK #1
DEBUG | ??:??:?? 14 Using AES128 key!
DEBUG | ??:??:?? 14 ESP32 crypt fr=55c6a2a0, num=5412efc9, numBytes=6!
DEBUG | ??:??:?? 14 enqueuing for send (id=0x5412efc9 fr=0xa0 to=0xff, WantAck=0, HopLim=3 Ch=0x8 encrypted)
DEBUG | ??:??:?? 14 txGood=0,rxGood=0,rxBad=0
DEBUG | ??:??:?? 24 [Power] Battery: usbPower=1, isCharging=0, batMv=0, batPct=0
DEBUG | ??:??:?? 24 [RadioIf] Completed sending (id=0x5412efc8 fr=0xa0 to=0xff, WantAck=0, HopLim=3 Ch=0x8 encrypted priority=64)
DEBUG | ??:??:?? 14 No modules interested in portnum=0, src=LOCAL
makes me think that the none of the receivers want to pick up the message for some reason??
This is the piece of code I am using to send the message.
const int sensor_pin = 2;
int moist;
moist = analogRead(sensor_pin);
LOG_DEBUG(âMoisture reading is %d\nâ, moist);
meshtastic_MeshPacket *z = router->allocForSending(); //Initialize packet struct
z->decoded.payload.size = sizeof(moist);
memcpy(z->decoded.payload.bytes, &moist, z->decoded.payload.size);
LOG_DEBUG(âMsg from=0x%0x, id=0x%x, msg=%.*s\nâ, z->from, z->id, z->decoded.payload.size, z->decoded.payload.bytes);
service.sendToMesh(z);
Any help would be appreciated. Cheers.