xreef / LoRa_E32_Series_Library

Arduino LoRa EBYTE E32 device library complete and tested with Arduino, esp8266, esp32, STM32 and Raspberry Pi Pico (rp2040 boards). sx1278/sx1276
https://www.mischianti.org
Other
352 stars 72 forks source link

sendFixedMessage Parameters Issue #17

Closed cglkr97 closed 4 years ago

cglkr97 commented 4 years ago

Ciao Renzo!

I'm trying to do a project where I tell my sender E32 which receiver address it will send the message to. I give the address info via serial monitor. I ask the user to provide the ADDH, ADDL, CHAN bytes. For example I give the ADDH=0 ADDL=0 and CHAN=17 and pass these into sendFixedMessage as parameters.

ResponseStatus wakeMes = e32ttl.sendFixedMessage(ADDH,ADDL,CHAN, "Sensor Data");

But when the sender sends to this address, the receiver gives overflows and data get messed up since I can't write the CHAN byte as 0x17.

I've tried writing it as, ResponseStatus wakeMes = e32ttl.sendFixedMessage(ADDH,ADDL,Serial.print(23,HEX), "Sensor Data"); but it again gave overflow and data got messed up.

Is there any other way that I can store the serial byte input as hex and then pass it into sendFixedMessage function as address parameter?

I've tried doing this, byte b =Serial.println(a,HEX); Serial.println(b); but again, it always turned something incorrect.

Or is there any other way that I could play with your library to make the sendFixedMessage function to accept the user input byte without writing it as 0xCHAN?

Thanks, C.

xreef commented 4 years ago

Hi cglkr97, can you send the complete code PLZ. Thanks Renzo

cglkr97 commented 4 years ago

Hi Renzo, Here is my code. gatewayFixedMessage2.txt

Thanks,

xreef commented 4 years ago

Hi cglkr97, I moved this discussion on my forum because become quite interesting. https://www.mischianti.org/forums/topic/ebyte-e32-sendfixedmessage-parameters-issue/ Check It please. Bye Renzo