@beegee I’ve compiled the “Sensor Solution” repo not the RAK1906 because i’ve the RAK1901 sensor. Anyway, i’m downloading now and i’ll let you know, thanks
After this put the @1.0.4 on the version seems to resolve the problem
Now it compiles but finds some problems (sorry for the image, i don’t know how to paste the problem log)
It will throw a lot of warnings (yellow), but it should compile. The warnings are mostly coming from the included libraries (unused variables, redefinition of macros, …) but nothing serious.
What you see in the Problem tab are all warnings. You can ignore them.
For the Sparkfun library, I don’t know why they removed the version 1.0.0 from Github.
The old V1.0.0 version was still in my project library folder, so it didn’t throw the error. Now I see it as well.
I updated the platformio.ini and tried again, it compiles and runs.
Ok, I’ll try to put the fimware to work and i’ll let you know, thanks.
I was thinking if it will be possible to have one or more P2P sensor(s) (maximum 3) and put via the AT-Commands another one RAK4631 in P2P Rx mode and read the sensor via serial console, maybe via the usual Node-RED exec node. What do you think?
Yes, that should be definitely possible.
You will have to decode the payload from CayenneLPP format in NodeRED in that case.
@beegee Hi Bernd, so far i’ve uploaded successfully the firmware on both the sender (RAK4631 + RAK19007 + RAK1901) and the receiver (RAK4631 + RAK19007) thanks to your firmware. After setting both of the MCU on P2P LoRa mode, i’m trying to set the receiver that will continuously listen to P2P LoRa TX packets without any timeout with the AT command AT+PRECV=65534, it respond with OK but asking if the parameter is stored it looks like it isn’t
As you can see, i’m using Putty to comunicate with the MCU, what i’m doing wrong?
EDIT: I found this and now it works:
but why i can’t see what is transmitted but only this log?
I can see the temperature and humidity readings on the transmitter every 60 seconds if connected via the COM port to the sender
The AT command manual is for our RUI3 firmware (RAK3172, RAK11720, RAK4631 with RUI3).
Most of my example codes are not based on RUI3. I tried to copy the RUI3 AT commands as good as possible, but there are still some differences between the AT commands.
But in any case, you have to start P2P RX explicitly, it is not saved in Flash and not automatically enabled on next reboot/start-up.
For the payload decoding, in the RX functions, you see the plain uint8_t value array and you still have to decode them.
You will something like my parse_send() function to see the decoded sensor values.
@beegee ah ok, i see. Unfortunately decoding the array or trying to implement your function in Node-RED directly will beyond my technical knowledge at the moment. Is that array unit8_t the CayenneLPP format?
Yes, it is CayenneLPP format.
NodeRED is Javascript, so you might be able to use our Javascript decoders for LoRaWAN servers as a start. ==> RAKwireless_Standardized_Payload
I never tried to decode the payload directly in NodeRED, but there is a CayenneLPP payload decoder available ==> node-red-contrib-cayennelpp-extended (node) - Node-RED
From that NodeRED palette I found ==> CayenneLPP/decoders/decoder.js at master · ElectronicCats/CayenneLPP · GitHub
which might work already:
// To use with NodeRED
// Assuming msg.payload contains the LPP-encoded byte array
/*
msg.fields = lppDecode(msg.payload);
return msg;
*/
@beegee thanks for your help as usual. At the moment, i can receive the payload via Node-RED but it looks like i can’t decode it.
This is the payload:
+EVT:0268640367011B017401A900FF564DC1F3
even after removing the +EVT: part still i can’t use it. Can you please confirm if it is a valid payload or it needs to be reworked before decoding it?
Yes, it is a valid payload, but there are some “none” standard sensor values in it:
Valid part:
Temperature, humidity and battery voltage.
But a “standard” decoder does not recognize the sensor type 255, I used that to add the device ID.
I have decoder in Datacake who can work with that
Here is what you can do:
+EVT:0268640367011B017401A900FF564DC1F3
is an Ascii string
(1) remove the +EVT:
(2) convert the Ascii string to an uint8_t buffer:
0268640367011B017401A900FF564DC1F3
to
var buffer = [0x02, 0x68, 0x64, 0x03, 0x67, 0x01, 0x1B, 0x01, 0x74, 0x01, 0xA9, 0x00, 0xFF, 0x56, 0x4D, 0xC1, 0xF3];
(3) use an existing decoder to parse the sensor values from the uint8_t buffer to the sensor types and values
I have made a NodeRED function that can do (2) and (3), but I am not sure how you receive the data in NodeRED.
@beegee
Yep, it worked finally!
I imagine there is no possibility to add an address to the sensor node, like you already warned on the readme of your P2P Gateway PoC repository, right?
At this point, I want to move the discussion to WisBlock LoRa P2P Gateway to MQTT Broker or HTTP Post service, because this has nothing to do with Meshtastic anymore.
I’ll answer you there.