Thingspeak and fields

Hello,
i have a problem, to assign sensors to fields in ThingSpeak.

On the web-interface of the LowCostLoRaGw (Raspberry PI), under Cloud/ThingSpeak i filled the fileds “Write Key” with the key and “Source List” with [“6”] for my sensor.
This works and fills field 1 of my ThingSpeak channel.

But: i want to fill field 4 of this channel!

How can i define this? (i tried to edit “key_ThingSpeak.py”, but this didn’work also.
I read this doku, but this didn’t helped me too.
https://github.com/CongducPham/LowCostLoRaGw/blob/master/gw_full_latest/README-NewCloud.md

Regards
Juergen

Hi, the web interface cannot be used for that kind of advanced setting. You have to use ssh and edit key_ThingSpeak.py. See the examples from https://github.com/CongducPham/LowCostLoRaGw/blob/master/gw_full_latest/key_ThingSpeak.py

Thanks!
Exactly i did this in my Arduino-Sensorsketch:

// CHANGE HERE THE LORA MODE, NODE ADDRESS
#define LORAMODE 1
uint8_t node_addr=6;
// CHANGE HERE THE NUMBER OF SENSORS, SOME CAN BE NOT CONNECTED
const int number_of_sensors = 1;
// Sensor(nomenclature, is_analog, is_connected, is_low_power, pin_read, pin_power, pin_trigger=-1)
sensor_ptrs[6] = new DS18B20((char*)“DS”, IS_NOT_ANALOG, IS_CONNECTED, low_power_status, (uint8_t)3, (uint8_t) 4 /no pin trigger/);

Question: Sensor-nomenclature is used for what?

This is my key_ThingSpeak.py:

# LoRa channel for ThingSpeak:
_def_thingspeak_channel_key=‘OZ0OQ39VYPFVFCM2’
# i use only addr 6
source_list=[“6”]
key_association=[]
# sensor 6 to field 3
field_association=[(6,3)]
nomenclature_association=[]
# (“TC”,0) means that if nomemclature is “TC” then the offset for field index will be 0
# nomenclature_association=[(“TC”,0),(“HU”,1),(“LU”,2),(“CO2”,3)]

But this doesn’t work. It fills everytime field 0.

Regards
Juergen

Nomenclature is to differenciate fields. Ex: TC/22.5/HU/50/LUM/45/…

So if you have sensor 6 with 3 fields, TC, HU and LUM and you want these values to be mapped to a thingspeak channel in fields 1, 2 and 3:

field_association=[(6,1)]
nomenclature_association=[(“TC”,0),(“HU”,1),(“LUM”,2)]

1 Like

Thank you!
Now it works!