CSE7766 ESP8266 Arduino library and firmware https://github.com/vanvuongngo/CSE7766.git fork of https://github.com/ingeniuske/CSE7766.git
Created stand alone library for the Sonoff Pow R2 power switch with energy monitor witch uses the CSE7759/ CSE7766 as power monitor sensor. Based upon the excelent espurna platform of Xose Pérez "Home automation firmware for ESP8266-based devices"
https://github.com/xoseperez/espurna/blob/dev/code/espurna/sensors/CSE7766Sensor.h
The serial port ground from the Sonoff device is directly connected to AC-mains.
Be carefull it could potentially destroy your devices if connected directly!
- download the firmware see https://github.com/vanvuongngo/CSE7766/releases
- install esptool.py` see https://github.com/espressif/esptool
- call
esptool.py flash_id
to receive the serial port - flash e.g.
esptool.py --port /dev/ttyUSB0 write_flash 0x0 cse7766.bin
- modify
src/main.cpp
- comment out upload_protocol and upload_port if you want to upload over serial port
- for production if you want to disable debug tool or OTA see platformio.ini
- execute build and flash firmware
- copy the directory
lib/CSE7766
into your arduino library directory - open
example/CSE7766_basic.ino
Copyright (C) 2016-2018 by Xose Pérez
Copyright (C) 2018 by Ingeniuske
Copyright (C) 2021 by Van Vuong Ngo <20791239+vanvuongngo at users dot noreply dot github dot com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.