Friday, 16 February 2024

Getting a Heltec CubeCell Dev-Board Plus (HTCC-AB02) project up and running again..

 So I decided to see what state this project board was in today...



First to fire up Arduino IDE and see if it is talking on serial port,,

16:09:29.736 -> Copyright @2019-2020 Heltec Automation.All rights reserved.
16:09:29.923 -> (Weds 13th Sept 2023 09:13) (CubeCell-Board Plus (HTCC-AB02)) SLAN-032 BME680 Sensor (LoRaWAN_BMP680_3)
16:09:29.970 -> Starting ESP32FeatherWiFiDemo for BME680
16:09:29.970 -> - Initializing BME680 sensor
16:09:29.970 -> -  Unable to find BME680. Trying again in 5 seconds.
16:09:35.050 -> -  Unable to find BME680. Trying again in 5 seconds.

That looks hopeful. So I looked for that sketch found a listing in an old e-mail LoRaWan_BMP680_3.ino so saved it to a folder and loaded into IDE.

Changed name to LoRaWAN_BMP680_4 and compiled and flashed..

16:23:50.284 -> Copyright @2019-2020 Heltec Automation.All rights reserved.
16:23:50.518 -> (Fri 16th Feb 2024 16:18) (CubeCell-Board Plus (HTCC-AB02)) SLAN-032 BME680 Sensor (LoRaWAN_BMP680_4)
16:23:50.518 -> Starting ESP32FeatherWiFiDemo for BME680
16:23:50.518 -> - Initializing BME680 sensor
16:23:50.565 -> -  Unable to find BME680. Trying again in 5 seconds.
16:23:55.641 -> -  Unable to find BME680. Trying again in 5 seconds.

All good so let's connect up a BME680 sensor..

VCC - red -

GND - brown -

SCL - yellow -

SDA - orange -


https://heltec.org/project/htcc-ab02/




So this is wired,,


16:40:44.243 -> 
16:40:44.243 -> AT Rev 1.3
16:40:44.243 -> +AutoLPM=1
16:40:44.243 -> 
16:40:44.243 -> +LORAWAN=1
16:40:44.243 -> 
16:40:44.243 -> +KeepNet=0
16:40:44.243 -> +OTAA=1
16:40:44.243 -> +Class=A
16:40:44.243 -> +ADR=1
16:40:44.291 -> +IsTxConfirmed=1
16:40:44.291 -> +AppPort=13
16:40:44.291 -> +DutyCycle=300000
16:40:44.291 -> +ConfirmedNbTrials=4
16:40:44.291 -> +ChMask=0000000000000000000000FF
16:40:44.291 -> +DevEui=70B3D57ED004AFD7(For OTAA Mode)
16:40:44.291 -> +AppEui=0000000000000000(For OTAA Mode)
16:40:44.291 -> +AppKey=AEE3B1AF66A5594D6CAA49EA26645BFA(For OTAA Mode)
16:40:44.291 -> +NwkSKey=00000000000000000100010003000600(For ABP Mode)
16:40:44.291 -> +AppSKey=72640C00C40700000000000000000000(For ABP Mode)
16:40:44.291 -> +DevAddr=007E6AE1(For ABP Mode)
16:40:44.291 -> 
16:40:44.291 -> 
16:40:44.291 -> LoRaWAN EU868 Class A start!
16:40:44.291 -> 
16:40:44.458 -> joining...joined
16:40:50.144 -> {"SupplyVoltage":"3466", "Temperature":"19.60", "Humidity":"67.82", "Altitude":"-27.94"}
16:40:50.179 -> confirmed uplink sending ...
16:40:55.538 -> received unconfirmed downlink: rssi = -58, snr = 14, datarate = 5
16:40:55.573 -> {"SupplyVoltage":"3466", "Temperature":"19.37", "Humidity":"67.89", "Altitude":"-28.10"}
16:40:55.573 -> confirmed uplink sending ...
16:41:00.957 -> received unconfirmed downlink: rssi = -59, snr = 13, datarate = 5

Seems to be working fine..


v3/tola-park-environment@ttn/devices/slan-032/join

{"end_device_ids":{"device_id":"slan-032","application_ids":{"application_id":"tola-park-environment"},"dev_eui":"70B3D57ED004AFD7","join_eui":"0000000000000000","dev_addr":"260BE51D"},"correlation_ids":["gs:uplink:01HPSCNC3ZCCMFE0KWC4ERGRHV"],"received_at":"2024-02-16T16:40:46.227092695Z","join_accept":{"session_key_id":"AY2yyrCHtYZdueKcy6lmkw==","received_at":"2024-02-16T16:40:44.416586220Z"}}





v3/tola-park-environment@ttn/devices/slan-032/up

{"end_device_ids":{"device_id":"slan-032","application_ids":{"application_id":"tola-park-environment"},"dev_eui":"70B3D57ED004AFD7","join_eui":"0000000000000000","dev_addr":"260BE51D"},"correlation_ids":["gs:uplink:01HPSCNQ0CK2KATW9NTAYV7HY4"],"received_at":"2024-02-16T16:40:55.773798256Z","uplink_message":{"session_key_id":"AY2yyrCHtYZdueKcy6lmkw==","f_port":13,"f_cnt":1,"frm_payload":"pPTqWzaDig2IPA==","decoded_payload":{"battery":35341, "gas_resistance":348.76, "humidity":5999.5, "pressure":1387.8, "temperature":422.28},"rx_metadata":[{"gateway_ids":{"gateway_id":"eui-b827ebfffebc60e2","eui":"B827EBFFFEBC60E1"},"time":"2024-02-16T16:40:55.557862043Z","timestamp":30150331,"rssi":-69,"channel_rssi":-69,"snr":10.5,"location":{"latitude":52.7096664658595,"longitude":-8.88603665286287,"altitude":10,"source":"SOURCE_REGISTRY"},"uplink_token":"CiIKIAoUZXVpLWI4MjdlYmZmZmViYzYwZTISCLgn6//+vGDhELudsA4aDAiXoL6uBhCuiJuNAiD4lOao8LIZ","received_at":"2024-02-16T16:40:55.554548393Z"}],"settings":{"data_rate":{"lora":{"bandwidth":125000, "spreading_factor":7, "coding_rate":"4/5"}}, "frequency":"868100000", "timestamp":30150331, "time":"2024-02-16T16:40:55.557862043Z"},"received_at":"2024-02-16T16:40:55.565555763Z","confirmed":true,"consumed_airtime":"0.061696s","version_ids":{"brand_id":"heltec", "model_id":"cubecell-1-2-aa-node-class-a-otaa", "hardware_version":"_unknown_hw_version_", "firmware_version":"1.0", "band_id":"EU_863_870"},"network_ids":{"net_id":"000013","ns_id":"EC656E0000000181","tenant_id":"ttn","cluster_id":"eu1","cluster_address":"eu1.cloud.thethings.network"}}}


So can I just added the 3x small PV solar panels to it, box it up and put it in Westpark?

Changed update time from 5 minutes to 30 minutes and turned off status LEDs to save battery power. And to draw less attention to it :)

16:48:58.732 -> joining...joined
16:49:03.955 -> {"SupplyVoltage":"3512", "Temperature":"18.02", "Humidity":"71.18", "Altitude":"-29.43"}
16:49:03.955 -> confirmed uplink sending ...
16:49:09.120 -> received unconfirmed downlink: rssi = -58, snr = 13, datarate = 5
17:09:04.668 -> {"SupplyVoltage":"3530", "Temperature":"18.01", "Humidity":"71.08", "Altitude":"-29.60"}
17:09:04.668 -> confirmed uplink sending ...
17:09:09.810 -> received unconfirmed downlink: rssi = -68, snr = 14, datarate = 5

Looking good battery charging as tethered via USB to laptop.

These three 2v panels put out 6v+ when sunny.



Hard to see below but the orange charge LED is on.



Will connect to PV panel later.






Monday, 12 February 2024

LS2024B WiFi Monitor

I have built one of these before but thought I'd revisit the project.

I have based this on the excellent Blynk project:

https://github.com/tekk/Tracer-RS485-Modbus-Blynk-V2


First I built a breadboard prototype powered by a Lithium 12v battery and a probably broken 100W solar panel connected to an Epever LS2024B charge connector.





There are 4 wires from the RJ45 plug 0v (brown), +7.5v (orange), A (blue) and B (green).



The first two go to the 5v-9v to 5v converter. The output of which +5v and GND go to Vin and GND of the NodeMCU.

The last two A and B go to the A and B inputs of the RS485 converter. The GND and VCC of this converter come from the GND and +5v of the NodeMCU. That leaves the 4 pins DI, DE, RE and RO of this device. The DI (data in) pin is wired to RX of NodeMCU (brown wire) and the RO (data out) is wired to the TX pin of the NodeMCU (red wire) while the two enable pins DE and RE and wired together and connected to D2 of the NodeMCU (orange wire).

 

This worked OK once I'd updated the sketch to use the latest Blynk API.


But is was mains powered rather than using the 7.5v provided by the LS2024B. So I sent off for some 5-9v to 5v adaptors and prepared to box up the project.




After checking this produced 5v from the RS45 cables 7,5v I plugged the USB-A connector into the uUSB connector of the NodeMCU and ensured Blynk was happy! :)



So next was to move from a breadboard to a box.




I have also used a 4 pin connector. Looking from inside the box:

https://ie.farnell.com/binder/99-0609-00-04/plug-free-4way/dp/1122398
https://ie.farnell.com/binder/99-0612-00-04/socket-panel-4way/dp/1122416



1O        O4   1- blue        3- green

   2O  O3      2 - orange   4 - brown

I think wiring up this fella was the trickiest part of the project (Did it twice as I forgot a securing sleeve the first time!)



A pity I cannot use Wowki for NodeMCU. But it is ESP2866 rather than ESP32 based.

https://docs.wokwi.com/getting-started/supported-hardware

So I will try fritzing. Great software well worth 8 euro.

Here's a circuit diagram:



And here's the wiring layout for the components in the box.



I recommend Fritzing. Cannot code simulate Modbus comms but great for drawing :)


Well did some temporary wiring to check out the new circuit and it worked well, after swapping A and B wires. So now to solder these wires and box it up ready for field trials :)


Testing the LS2024B (without PV panel) on a 12v LiFEPO4 battery :) (Guess I should check my Blynk readings against Renogy DC Home app - though there will be a voltage drop form the battery)




A bit of a nest of wires but feel better trying this before committing to solder wires that will fit tightly into the project box.


Blynk app is happy reporting battery voltage.




At first, unit came online but present no battery voltage as no Modbus comms because I got A and B the wrong way round!

Next to solder these wires and fit the boards in a box to field test with a PV panel as well as a battery attached and also to check if Blynk provides an API so I can MQTT the data transmitted.


So boxed up boards and deployed with probably broken 100W PV panel in the shed.













So that concludes this stage of the project. Next I'll see if I can access this Blynk data via an API and add it to MQTT and a database for graphing :)

I'll also github the modified Arduino code.