|
Post by Jason on Mar 1, 2022 4:04:44 GMT -8
I'm writing to share my plans for SG3 with the broader community in case anyone else might be interested. At this time, I don't have much interest in building a full SG3 deployment for our patio. However, I'm hopeful that my wife may become interested eventually. In the meantime, I'd like to simply deploy an array of moisture sensors around our patio in an effort to try and keep some plants alive this summer.
I have cloned the SwitchDoc Labs repository and have stripped out all of the code except for the web server to configure WiFi connectivity and the code for reading the BlueTooth moisture sensors. I'm going to be building a flow in NodeRED to handle the MQTT messages produced by the sensors. I'll provide updates along the way as I find failure/success in case other folks have a similar use case in mind.
Thanks,
Jason
|
|
|
Post by Jason on Mar 3, 2022 4:10:32 GMT -8
Progress to date has been to get the WiFi and MQTT setup completed. On to BT sensors.
Thanks,
Jason
|
|
|
Post by Jason on Mar 3, 2022 4:21:56 GMT -8
First BT sensor setup and sending data. That was easy!
Thanks,
Jason
|
|
|
Post by Jason on Mar 3, 2022 4:54:12 GMT -8
If I'm understanding the code correctly, is it possible to have multiple extenders such as an indoor extender and an outdoor extender? If so, does that mean that each extender can support up to 16 sensors each?
Thanks,
Jason
|
|
|
Post by SDL on Mar 4, 2022 11:10:31 GMT -8
Yes, multiple extenders, each with 16 bluetooth sensors. One of our test units is running two extenders outside. Each with 5 Sensors on them. It's down in Palm Springs and I am adding another 10 sensors next week!
BP
|
|
|
Post by Jason on Mar 4, 2022 11:50:26 GMT -8
I'm running into an odd issue that I'm hoping you can monitor when you add the additional sensors. I can't get more than nine sensors to read on my ESP32. I've intentionally manipulated distances from the ESP32 to confirm that the furthest from the ESP32 work. I've also added each individually to confirm they work as well and all are good in their current locations. The final test I ran was to add one at a time to the ESP32 so 1 to 2 to 3, etc. up to 10 on the ESP32. The first 9 added read consistently and the tenth does not. I'm going to test another board from a different manufacturer ASAP but I'm curious to see if you experience any challenges with having more than 9 on a single extender.
Thanks,
Jason
|
|
|
Post by SDL on Mar 4, 2022 11:57:12 GMT -8
I have a theory, that I can't test until next week. In the car (not driving) to Seattle It could be that over 9 Bluetooth Sensors goes over the max MQTT message size on either the Pi or the Extender.
Could you look at the output from SG3, find the bluetooth sensor assignment message (should be obvious near the beginning) and post it?
BP
|
|
|
Post by Jason on Mar 4, 2022 20:18:26 GMT -8
SG3.py? Or output from the extender .ino file?
Thanks,
Jason
|
|
|
Post by Jason on Mar 5, 2022 8:18:11 GMT -8
Here's the output I receive in Paw after calling 192.168.50.117/assignBluetoothSensors with 16 moisture sensors: {"return_value": 1, "id": "1879", "name": "", "ipaddress": "192.168.50.117", "hardware": "esp32", "hydroponicsmode": "false","return_string": "", "connected": true} Thanks, Jason
|
|
|
Post by SDL on Mar 5, 2022 17:08:19 GMT -8
I need to see the command you are sending. then do some character counting!
BP
|
|
|
Post by Jason on Mar 6, 2022 6:20:38 GMT -8
Ah okay! 192.168.50.117/assignBluetoothSensors?params=admin, followed by 447 characters of URL-encoded MAC addresses and commas. Here is the full command: GET /assignBluetoothSensors?params=admin,C4%3A7C%3A8D%3A6E%3A01%3A3D,C4%3A7C%3A8D%3A6E%3A03%3A7A,C4%3A7C%3A8D%3A6E%3A0D%3AD2,C4%3A7C%3A8D%3A6E%3A0D%3ADB,C4%3A7C%3A8D%3A6E%3A04%3ACC,C4%3A7C%3A8D%3A6E%3A02%3A25,C4%3A7C%3A8D%3A6E%3A03%3ABC,C4%3A7C%3A8D%3A6E%3A05%3A65,C4%3A7C%3A8D%3A6E%3A05%3A7C,C4%3A7C%3A8D%3A6E%3A04%3ABC,C4%3A7C%3A8D%3A6E%3A05%3A7A,C4%3A7C%3A8D%3A6E%3A04%3AB1,C4%3A7C%3A8D%3A6E%3A05%3A26,C4%3A7C%3A8D%3A6E%3A05%3A78,C4%3A7C%3A8D%3A6E%3A05%3A76,C4%3A7C%3A8D%3A6E%3A04%3A98 Thanks, Jason
|
|
|
Post by SDL on Mar 6, 2022 13:43:46 GMT -8
Well, I checked and the max is 1024 in the Extender. I'll have to run a test using your data and see on what end this is getting hosed up. Maybe later today.
BP
|
|
|
Post by SDL on Mar 6, 2022 16:18:41 GMT -8
Well, it's not the MQTT length. Somethings else. I see your 16 being added:
SensorCycle=600
16:18:10.580 -> HydroponicsLevelMode=0
16:18:10.580 -> BluetoothAddresses[0]=C4:7C:8D:6E:01:3D
16:18:10.580 -> BluetoothAddresses[1]=C4:7C:8D:6E:03:7A
16:18:10.580 -> BluetoothAddresses[2]=C4:7C:8D:6E:0D:D2
16:18:10.580 -> BluetoothAddresses[3]=C4:7C:8D:6E:0D:DB
16:18:10.580 -> BluetoothAddresses[4]=C4:7C:8D:6E:04:CC
16:18:10.580 -> BluetoothAddresses[5]=C4:7C:8D:6E:02:25
16:18:10.580 -> BluetoothAddresses[6]=C4:7C:8D:6E:03:BC
16:18:10.580 -> BluetoothAddresses[7]=C4:7C:8D:6E:05:65
16:18:10.580 -> BluetoothAddresses[8]=C4:7C:8D:6E:05:7C
16:18:10.580 -> BluetoothAddresses[9]=C4:7C:8D:6E:04:BC
16:18:10.580 -> BluetoothAddresses[10]=C4:7C:8D:6E:05:7A
16:18:10.617 -> BluetoothAddresses[11]=C4:7C:8D:6E:04:B1
16:18:10.617 -> BluetoothAddresses[12]=C4:7C:8D:6E:05:26
16:18:10.617 -> BluetoothAddresses[13]=C4:7C:8D:6E:05:78
16:18:10.617 -> BluetoothAddresses[14]=C4:7C:8D:6E:05:76
16:18:10.617 -> BluetoothAddresses[15]=C4:7C:8D:6E:04:98
16:18:10.617 -> --------------------------
I'll continue to dig.
BP
|
|
|
Post by SDL on Mar 6, 2022 16:34:15 GMT -8
Not sure what is going on. It is trying all 16 addresses as expected. When you have more than 10, what is your LCD displaying?
BP
|
|
|
Post by Jason on Mar 7, 2022 13:59:19 GMT -8
If I was a betting man, I’d bet I hacked out some code that I should not have. I’m also having stability issues where running 9 and 7 moisture sensors on separate chips only runs for about three hours before both chops reset and need to be configured. As a result, I’m going to slowly add sensors over a week or so and see where stability becomes problematic.
I’m not actually using anything other hardware besides the ESP32 microcontrollers and the BT sensors. As a result, I’m going to have to setup my Mac downstairs in order to troubleshoot because right now I’m running the chips blind.
Thanks,
Jason
|
|