Coolcam wifi motion sensor PIR

Was about to start working on it couple of days, but then saw and squirrel and got completely distracted. haha

I did receive the FTDI programmer the other day, so i just need to figure out the GPIO pin situation on that thing. Really don’t see the need for anything other than 4 pins to program this thing

keep me posted

Hit a snag… FTDI adpter i received turned out to be a complete junk. it was literally missing solder points and had damaged wires. (I bought one that looked like a cut-off USB cord with a plug on one end and wires on the other). A new one is on its way and should be here this Wednesday.

Deep sleep is probably enabled since battery can last longer than expected I presume.
Any updates on this? From the first image it seems rx, tx and gnd to be the bottom 3 pins and 3v3 being the top second pin (right to left).

Can’t flash

Well I have made a bit more progress on the WiFi PIR Sensor.

I have managed to flash the Chip but I had to remove the SPI flash chip and program it in my programmer though. I can get Tasmota web interface up long enough to get it to connect to my WiFi. But it seems to shut it’s self down / go into low power mode? I have to hold down the button for about 10s or so for it to come alive again. I need to look to see if I can issue a command in the console to get it to stay alive.

I haven’t fully traced the circuit yet though. But there is a PIR interface chip on board it’s a E931.96B
According to the datasheet yo can program it and then listen on a pin which gives an interrupt signal when motion is detected. There is also a 3rd chip on the board (bottom of picture) which has the markings SB10F8G. I don’t know if that’s referring to a EFM8SB10F8G-QFN20?

I did download the original firmware if anyone wants to take a look at it and figure out how this device works?

Has anybody managed to get this device flashed? I got 2 units waiting to be used :slight_smile:

I simply connected the marked PIN’s to my USB to TTL converter. Bring it to flash mode with connecting GPIO0 to GND while plugging in. And remember to crossover RXD and TXD.

But I have the same problem as wills106, It is going to deep sleep after approximately 40 seconds and not waking up again. Side note, continuous pinging isn’t keeping it alive.

thats my esphomelib yaml so far:

 esphomeyaml:
   name: pir2
   platform: ESP8266
   board: esp01_1m
   board_flash_mode: dout
 #  esphomelib_version: dev
   arduino_version: latest
 
 wifi:
   ssid: '!ssid'
   password: '!wifi_pwd'
## power_save mode has no effect on deep_sleep so far
#   power_save_mode: light
 
mqtt:
   broker: '!broker_ip
   username: '!mqtt_user'
   password: '!mqtt_pwd'
 
 # Enable logging
 logger:
   level: VERY_VERBOSE
 ota:
   password: '!some_pwd'
## not found out any pins yet
 binary_sensor:
#  - platform: gpio
#    pin: 
#       number: GPIO14
#     name: "esp_xxx_pir"
#     device_class: motion
   ## https://esphomelib.com/esphomeyaml/components/binary_sensor/status.html
   - platform: status
     name: "esp_xxx_pir_system_status"
     id: "esp_xxx_pir_system_status"
 
 sensor:
   ## https://esphomelib.com/esphomeyaml/components/sensor/uptime.html
   - platform: uptime
     name: "esp_xxx_pir_system_uptime"
     id: esp_xxx_pir_system_uptime
 
   ## https://esphomelib.com/esphomeyaml/components/sensor/wifi_signal.html
   - platform: wifi_signal
     name: "esp_xxx_pir_system_wifi_signal"
     id: esp_xxx_pir_system_wifi_signal
     update_interval: 15s

I’m interested too to understand if it is possibile flash the PIR device with new firmware :smiley:

Someone who know a bit about programming needs to figure out what that EFM8 Sleepy Bee is doing as I think that’s what’s putting it to sleep.

The other option is to change the mqtt address in the stock ROM. But I don’t know how to work out if there is some kind of hash check or some other security in there as I am not a programmer.

I think it is only necessary finding the PIN connecting the PIR to the ESP. That one should do the trick with a wakeup signal to the whole thing.

So far no news from my side.
I tried all GPIO’s. GPIO1-15 for the motion sensor in INPUT mode with esphomelib. No luck so far.
But it is flashable and WIFI OTA is working if you do it before it goes back into deep sleep.
after booting and connecting deep sleep occurs after 60 seconds.
I reflashed the original firmware and now it is back to normal.
Normal behaviour seems to be that a movement is waking up the PIR from deep sleep and it is sending a continuous signal for round about 20 seconds. than it is back to deep sleep after 60 seconds.

anyone any ideas how to figure out the output pin?

Are you trying to trace the PIR to the ESP or the PIR to the E931.96B and then the E931.96B to the ESP?

I’m trying to getr the connections to the esp right.
deep sleep mode semms a hardware implementation. if I put my ear next to the board I can hear some electric coil or inductor. after 60 seconds the board is in deep sleep again.
GPIO16 has to be the PIN the PIR is connected to. If the signal goes through other chips before doesn’t matter I think, because deep sleep reset is only working by triggering GPIO16 with this esp model.
after booting is completed the PIR seems to blink the two LED’s, so both of them must be connected to the same GPIO. I couldn’t figure out which one yet and don’t now if it’s inverted or not.

So it is not possible reflash this devices?
Thanks

I found this sotfware that could be usefull

I was unable to get my variant of this same device working with tuya-convert. I theorize that my vendor Waserstein (https://www.amazon.com/gp/product/B07FXBB2HP) might have their own tuya ‘servers’ making tuya-convert in it’s current form unusable.

In any case, I flashed the board directly by connecting to the helpfully labeled vias. BrandonD (https://github.com/brandond/esphome-tuya_pir) created a custom component for esphome that seems to work well. He’s also documented a lot of the specifics about sensors using this board in the README.

This work was the result of an issue born out of this specific esphome issue #306 created by Styx85 Thanks!

Does anyone have any tips with flashing this thing? I tried the pins and instructions from both @brandond and @Styx85 but keep getting:

INFO Running:  esptool.py --before default_reset --after hard_reset --chip esp8266 --port /dev/cu.usbserial-A9M9DV3R write_flash 0x0 .build/.pioenvs/ha_pir/firmware.bin
esptool.py v2.5.1
Serial port /dev/cu.usbserial-A9M9DV3R
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header

The FTDI adapter I’m using has flashed dozens of other ESP’s, so that can’t possibly be it.

Anyone run into problems flashing these?

I just followed @brandond instructions from here: https://github.com/brandond/esphome-tuya_pir and can confirm I was able to flash ESPHome on 2 of these devices. Thanks!

I have this sensor and it doesn’t seem to detect well. Am I doing something wrong? Mine is coccoon brand and I have to use the coccoon app which I can’t seem to get any notification that the sensor is detecting.
Any help would be greatly appreciated.