|
Post by doxidad on Nov 30, 2021 17:29:53 GMT -8
Polarity of the battery wires look correct.
I'd plug a charger (phone, tablet, kindle or whatever you happen to have) into the micro USB connector on the sun air board and let it charge overnight with the switch turned off. You should see a red LED light up and it will go out and a green LED will light up when the battery is fully charged.
|
|
|
Post by doxidad on Nov 28, 2021 12:22:33 GMT -8
sudo apt install iftop
|
|
|
Post by doxidad on Nov 26, 2021 14:51:40 GMT -8
Is this line 258 in WeatherSenseWireless.sql 258 ALTER TABLE `AS433MHZ` ADD PRIMARY KEY (`ID`); ?
If so, you don't need to execute the SQL script again. Once the database is built by the script, the database structure is created. If you run it again it will fail with that error since the primary key was created the first time it was run - you can only have one primary key on a table. If this was a purchased SD card, I would assume (might be wrong) that the database had already been created in the SD card image.
|
|
|
Post by doxidad on Nov 23, 2021 13:30:32 GMT -8
The problem is that the ESP32 only connects - sends the data - then disconnects. Happens fairly fast. using iftop - You may have to install this with apt *don't remember if I had to install this or not try sudo iftop -i wlan0 -P
I snagged this showing up showing a connection from my pi (WPI2) port 1883 connected to esp32-arduino and the the arduino sending back data to the same port.
WPI2.lan:1883 => esp32-arduino.lan:49643 0b 1.60Kb 411b <= 0b 0b 13.6Kb
You should be able to catch the connection - just have to make sure the connection is on port 1883
|
|
|
Post by doxidad on Nov 23, 2021 6:49:15 GMT -8
I did take the default 1883 on my original camera. I acquired another camera and explicitly typed in the 1883 - neither worked. That's when I forced the 1883 within the code and re-flashed. Once i had it working on both cameras I took the line of code that forced the 1883 and re-flashed again. Since the 1883 was already in non-volatile memory it still worked.
Are you using the Arduino IDE to communicate with the ESP32? I believe I had to load a USB->RS232 driver under windows for it to be seen properly. I'm not familiar with the Mac infrastructure.
|
|
|
Post by doxidad on Nov 22, 2021 17:34:17 GMT -8
Power off your AP for about 5 minutes until the camera AP shows back up. Reset your parameters on the camera and make sure the port is set to 1883. I had this problem and discovered that the MQTT port never got set so it was using port 0. I tried to reset it a couple of times with no results and ended up re-flashing the ESP32 code modified to force the port. Once the port is set in memory their is not a problem. Switchdoc says that they have not had any problems like this. I programmed this with Chrome on a Samsung tablet. Switchdoc had not used that combination - what browser/computer are a you using?
|
|
|
Post by doxidad on Nov 19, 2021 14:32:26 GMT -8
BP - Don't know if you were directing this to me or 0_0. So, since I am using SSDs also, here' what I'm using.
I have 2 of these units 1 used for my SkyWeather2 and the other as a development system.
SSD
KINGSTON Digital SUV500MS/120G 120GB SSDNOW UV500 Msata SSD 3.5 Internal Solid State Drive SSD Expansion board (Hat)
Geekworm Raspberry Pi 4 mSATA SSD Adapter X857 V2.0, Raspberry Pi 4 Model B X857 V2.0 mSATA SSD Expansion Board USB3.0 Module for Raspberry Pi 4B UASP Supported ONLY
Power Management board (Hat on the Hat)
Geekworm Raspberry Pi 4B/3B+/3B X735 V2.5 Power Management with Safe Shutdown & PMW Cooling Fan Expansion Board Compatible with Raspberry Pi 4 Model B
Case Geekworm case for all the above - Not sure of the part number, but you have to make sure you get one that fits all of the above hardware - there a number of the with the same part number but a different dash variant for different configs of hats.
I also use geekworm's PS for both systems.
You can find all of the geekworm items and their docs from geekworm.com/
Most, if not all parts, can be found on Amazon.
|
|
|
Post by doxidad on Nov 17, 2021 9:34:47 GMT -8
I think what is confusing is that I see posts about interrupts, debounce, etc, related to wind readings such as one of your replies. The code I see in rtl_433 is just the decoder from what I can see. Is the code you are referencing in that post run in the weatherrack2 unit? So the question is what can we do as users to affect the readings? Just trying to understand the architecture a little. Thanks! Tim "Sounds like you are getting two interrupts when you should be just getting one. I'm not sure why this is, but you might put a divide by 2 in the code to fix this." The quote you have above is for the SkyWeather - NOT SkyWeather2. SkyWeather used a different set of sensors. The data - counts, analog values were presented to the WeatherPIArduino board through wires and then the semi-processed data was read by the raspberry PI where it was stored.
SkyWeather2 uses the SkyWeather2 weather rack which totally self contained. It pops out a 433mhz JSON string and the Raspberry PI just reads, parses and stores it.
The SkyWeather2 rack is a 3rd party product - thus Switchdoc does not have the source code.
For the SkyWeather2, all of the code that resides in the PI is available and you can modify it to whatever your needs/wants are.
|
|
|
Post by doxidad on Nov 17, 2021 7:55:40 GMT -8
Thanks Doxidad. Sometimes I think you know this software better than I do! Nope, just have had 40+ years looking at other folks code to add/repair features (BTW - features are bugs wearing tuxedos ). You start learning how to figure out code flow quickly when you have customers wanting stuff fixed/added before you even got on site and you never have seen the code before. Or, having 24X7 production line shut down in the middle of the night because of a problem in L1, L1+ or L2 code that again you may have never seen before.
|
|
|
Post by doxidad on Nov 16, 2021 9:53:55 GMT -8
Just shooting in the dark here... How big is your Pi power supply? 3Amp is recommended for a Pi 4. SD cards don't like brown outs - especially when writing writing to them. I've given up running RPIs on SD cards for long term use - to many "it was working and now it isn't". Don't know how many SD cards I've tossed from hard failure. I've replaced all of the SDcards on my 2 always up PIs with SSDs. Here's an article that gives some insight to SD card corruption. Maybe there's something in it that may help. blog.robertelder.org/flash-memory-sd-card-corruption.
|
|
|
Post by doxidad on Nov 15, 2021 13:32:24 GMT -8
There are 2 jobs that run every day: cleanPictures which deletes pictures older than 14days and cleanTimeLapes that deletes timelapses older than 14 days. These are found in the module PictureManagement, You could change the number of days you want kept.
In the same module there is a function called buildTimeLapse that you could change the where clause on the SQL to limit the time range of the timelapse video created. That won't stop the pictures from being taken and stored every 50-60seconds though.
|
|
|
Post by doxidad on Nov 11, 2021 16:10:40 GMT -8
I'm wondering if it is a browser's problem. I provisioned it with an Samsung android tablet using Chrome. This was the easiest hardware I had to do the connecting to AP..
Since I had another camera/USB RS232 pair I flashed the 2nd esp32 with your code cloned from git and got the same results.
Once I changed the code and reflashed it worked. I put the code back to original and reflashed an it worked so the port number at that point got stored in the nonvolatile area.
|
|
|
Post by doxidad on Nov 11, 2021 4:32:26 GMT -8
OK - found the problem. It is in the ESP32 code.
Here is the output from the ESP32 when sending information. MQTT Start -------- MQTT_IP=192.168.200.85 MQTT_PORT=0 <-------< Attempting MQTT connection...client name=SKYCAMWireless-39e6 connected
Notice the MQTT Port is 0!
You can send stuff to port 0 all you want and it will be accepted - it's just like /dev/null
The port default when you set the camera through the AP is 1883 - for some reason this doesn't get stored properly?
I set up the Camera again through the AP and manually put in 1883 instead of taking the default and it still wasn't stored.
I added this line MQTT_PORT=1883;
right before
MQTTclient.setServer(MQTT_IP.c_str(), MQTT_PORT);
Recompiled the code and uploaded it to the camera.
It now works correctly and is publishing the data properly to mosquitto
To see if port is now correctly stored, I took the line I added out - recompiled/reloaded and it still works.
MQTT_IP=192.168.200.85 MQTT_PORT=1883 <-------< Attempting MQTT connection...client name=SKYCAMWireless-5a7a connected
So, once the port is stored it works OK. I assume the variable MQTT_PORT is store in a non volatile location? I didn't spend much time looking for the storage mechanism and where this value is stored.
If I had this problem maybe others will too!
|
|
|
Post by doxidad on Nov 10, 2021 7:55:13 GMT -8
FYI This is NOT your SD card distribution for the PI
I set up a terminal on the camera serial port. I have a couple of questions since I don't know what I should be expecting. The output says it has 10 chunks to send. Each chunk looks like it created 3 connections to broker. It seems it tries to send 11 chunks - 3 connections and then says Chunk Failure Then sending MQTT packet with data
All of the connection results are 0 (success)
All of the publish results are 0 (success). So I'm not sure if this is what I should see or not (3 connections for each chunk?, and trying to send 11 chunks?) and then a MQTT message. If so - where's it going that it is not recognized and written in the database?
Any special configuration for mosquitto other than listener 1883 and allow_anonymous true ?
Here's one iteration of a picture after CPU Freq = 240 MHz XTAL Freq = 40 MHz APB Bus Clock Freq = 80000000 Hz In Loop
Battery Voltage: 3.82 V Battery Current: 17.60 mA
Solar Panel Voltage: 2.65 V Solar Panel Current: 0.00 mA
Load Voltage: 5.00 V Load Current: 2.40 mA start of contrast delay CLICK Picture Size=22757 after take picture setupWiFiandMQTT GPIO0=1 RequestedReset=1 Using existing SSID/psk SSID=XXXXX psk=XXXXX Waiting for Saved WiFi .... WiFI Connected. SSID=XXXXXX psk=XXXXXX
IP Address: 192.168.200.222 WiFi Channel= 8 Gateway Address:192.168.200.1 Subnet Mask:255.255.255.0 -------- MQTT Start -------- MQTT_IP=192.168.200.85 MQTT_PORT=0 Attempting MQTT connection...client name=SKYCAMWireless-39e6 connected sub to topic=SKYCAM/C939/COMMANDS ----Writing Preferences--- SSID=XXXXX psk=XXXXXXX Admin Password:ad****** MQTT_IP=192.168.200.85 MQTT_PORT=0 time_to_sleep=50 contrast_delay=1000 Sensor Settings=0;0;0;0;1;1;0;1;0;0;300;1;0;0;0;1;1;1;0;0;1;0; blinkLight=1 frame_size=9 -------------------------- rssi:-44
numberOfFullChunks=10 lastChunkSize=257 Chunk Count=0 start of chunk=0 / end of chunk=2249 fb->len = 22757 ChunkStringLength=3000 Attempting MQTT connection...client name=SKYCAMWireless-77f9 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 1 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-3df4 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 1 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-b924 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 1 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Chunk Count=1 start of chunk=2250 / end of chunk=4499 fb->len = 22757 ChunkStringLength=3000 Attempting MQTT connection...client name=SKYCAMWireless-d658 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 2 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-880a connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 2 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-5980 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 2 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Chunk Count=2 start of chunk=4500 / end of chunk=6749 fb->len = 22757 ChunkStringLength=3000 Attempting MQTT connection...client name=SKYCAMWireless-4990 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 3 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-98cd connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 3 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-491f connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 3 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Chunk Count=3 start of chunk=6750 / end of chunk=8999 fb->len = 22757 ChunkStringLength=3000 Attempting MQTT connection...client name=SKYCAMWireless-1773 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 4 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-2bd connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 4 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-7a64 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 4 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Chunk Count=4 start of chunk=9000 / end of chunk=11249 fb->len = 22757 ChunkStringLength=3000 Attempting MQTT connection...client name=SKYCAMWireless-1b29 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 5 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-1fbe connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 5 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-2813 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 5 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Chunk Count=5 start of chunk=11250 / end of chunk=13499 fb->len = 22757 ChunkStringLength=3000 Attempting MQTT connection...client name=SKYCAMWireless-8089 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 6 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-41ce connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 6 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-9068 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 6 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Chunk Count=6 start of chunk=13500 / end of chunk=15749 fb->len = 22757 ChunkStringLength=3000 Attempting MQTT connection...client name=SKYCAMWireless-6da1 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 7 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-5f84 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 7 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-b5b3 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 7 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Chunk Count=7 start of chunk=15750 / end of chunk=17999 fb->len = 22757 ChunkStringLength=3000 Attempting MQTT connection...client name=SKYCAMWireless-fb0c connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 8 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-6e2d connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 8 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-49b8 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 8 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Chunk Count=8 start of chunk=18000 / end of chunk=20249 fb->len = 22757 ChunkStringLength=3000 Attempting MQTT connection...client name=SKYCAMWireless-5d9d connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 9 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-27f5 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 9 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-7b8f connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 9 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Chunk Count=9 start of chunk=20250 / end of chunk=22499 fb->len = 22757 ChunkStringLength=3000 Attempting MQTT connection...client name=SKYCAMWireless-d77e connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 10 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-d2a9 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 10 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 Attempting MQTT connection...client name=SKYCAMWireless-68ba connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Chunk 10 of 11 Topic=SKYCAM/C939/PICTURECHUNKS MQTT publish result=0 ->>>>Chunk Failure<<<<< Size of image:22757 Shape->width:800height:600 sendMQTTStats Attempting MQTT connection...client name=SKYCAMWireless-612 connected sub to topic=SKYCAM/C939/COMMANDS Sending MQTT Packet {"id": "C939", "messageid": "4223", "messagetype": "4", "softwareversion": "22", "sunairplusdevicepresent": "1", "hdc1080devicepresent": "0", "internaltemperature": "0.00", "internalhumidity": "0.00", "currentrssi": "-44", "batteryvoltage": "3.82", "batterycurrent": "17.60", "loadvoltage": "5.00", "loadcurrent": "2.40", "solarpanelvoltage": "2.65", "solarpanelcurrent": "0.00", "gndrreboots": "0"} Topic=SKYCAM/C939/INFO MQTT publish result=0 ----Writing MessageID Preferences--- MessageID=4224 -------------------------- RequestedReset=1 GPIO0=0 No Sleep - vTask Delay reducing power disable radio after CPU Freq = 10 MHz XTAL Freq = 40 MHz APB Bus Clock Freq = 10000000 Hz
|
|
|
Post by doxidad on Nov 9, 2021 14:51:55 GMT -8
Here's more information.
I have another ESP32 cam with the USB/RS232 programmer and I flashed it with the SkyCamera code. It does the same thing. It connects and asks to publish gets a Ack and about every minute it does a ping and gets an ack in response. Still no data sent or maybe it is and the broker can't see it for some reason. I would think once the connection is made and the request for publish is successful the pipe should be open. It looks like it is some sort of network problem - though I can't imagine what it would be. There are no filters on any local LAN addresses. Looks like I need to pull out wireshark and see if I can see anything.
I thought my days doing this stuff were done when I retired - bummer
|
|