The Online Documentation is HERE
To transfer the code to the microcontroller (ESP8266 or Robotdyn) it is necessary to install Visual Studio Code.
Once installed, you must install the PlatformIO package which will be used later for all your projects and not only for the Dimmer or the Pv router.
The sources are available on the Github (a code repository web server)
once your Visual Studio is launched, go to your Terminal and type
git clone https://github.com/xlyric/PV-discharge-Dimmer-AC-Dimmer-KIT-Robotdyn.git
it will then clone the repository on your machine and you can adapt the code to your needs and upload it.
PS C:\Users\c_lyr\Documents\PlatformIO\Projects\1> git clone https://github.com/xlyric/PV-discharge-Dimmer-AC-Dimmer-KIT-Robotdyn.git<br></br>Cloning into 'PV-discharge-Dimmer-AC-Dimmer-KIT-Robotdyn'...<br></br>remote: Enumerating objects: 179, done.<br></br>remote: Counting objects: 100% (179/179), done.<br></br>remote: Compressing objects: 100% (136/136), done.<br></br>Recote: Total 179 (delta 90), reused 119 (delta 38), pack-reused 0 eceiving objects: 75% (135/179)<br></br>Receiving objects: 100% (179/179), 630.36 KiB | 2.58 MiB/s, done.<br></br>Resolving deltas: 100% (90/90), done.
you can then go to the directory created during the command
Resolving deltas: 100% (90/90), done.<br></br>PS C:\Users\c_lyr\Documents\PlatformIO\Projects\1> ls<br></br><br></br> Directory: C:\Users\c_lyr\Documents\PlatformIO\Projects\1<br></br><br></br>Mode LastWriteTime Length Name<br></br>---- ------------- ------ ----<br></br>d---- 10/03/2022 16:53 pv-router-esp32
In the case of an update, you can update your code again with the following command
git pull
There is nothing more to configure in the dimmer,
you just have to upload the corresponding version to the dimmer.
Wifi configuration is done in Wifi autoconnect.
He creates a WiFi "dimmer" with a web interface accessible at 192.168.4.1 which allows you to configure your personal WiFi.
Uploading is done with Visual Studio Code (VS) using the PlatformIO tab
During your 1st Upload, you must plug in your ESP, wemos or TTL/USB adapter for programming
There are different versions available depending on what you are using as a dimmer.
-
PowerSupplyACdimmer is used for old version of Robotdyn dimmer,
this is the easiest version to install, it was compatible with the daughterboards supplied with the PV router V1.2 TTGO
the recommended maximum power is 5A (and not 8A as indicated by the manufacturer)
( D0 and D1(zc) are used )
the Dallas probe uses D2 -
StandAlone is used to later add a Robotdyn dimmer to your ESP.
-
SSR-JOTTA is used to live control an SSR The - connects to the GND and D4 to the + of the Jotta The Dallas probe uses D2
-
POWERSUPPLY2022 is for the 2022 version of the Robotdyn dimmer.
it requires a TTL adapter for the 1st programming.
the jumper between vdd and 3.3V must be removed during TTL programming
then put back when connecting the assembly to the 220VThe Dallas probe uses pin 14 - GND at 16 and 3.3v at 12
Once the version has been chosen, thanks to VS you will load the firmware and the HTML pages of the router into the microcontroller
Then you can directly upload the code remotely with the /update page of the router
Uploading is done with Visual Studio Code (VS) using the PlatformIO tab
your code being already present on the router, you can now directly generate the binary files to be sent.
In general, only the General Build is to be done.
The Build Filesystem Image is only there to update the HTML pages when functionalities evolve.
once the build is done:
it shows where the firmware is.
all you have to do is connect with the internet browser on your pv router and go to the /update page
and upload the firmware
In the case of updating the Filesystem (HTML file), it's the same procedure, you just have to take the Filesystem binary and select Filesystem.
The dimmer code uses the Wifi autoconnect library
at the 1st firmware upload, it will create a "dimmer" wifi
once the user is connected to this Wifi, the browser will redirect to the page http://192.168.4.1
to ask you to configure your Wifi
it will memorize your Wi-Fi connection confirmations even after a firmware update.
For more details: https://www.raspberryme.com/wifimanager-avec-esp8266-connexion-automatique-parametre-personnalise-et-gestion-de-votre-ssid-et-mot-de-passe/
Old Documentation
I remaster the distant dimmer with the new ALL in dimmer from Robotdyn ( and support 8A !! )
make a git clone of the project and use Visual Studio Code for build and upload to the board.
by default, D0 and D1 is used and solt on the board. D2 can be used by a Dallas 18b20, I explaint after how to make the small board
D5 D6 and D7 is configured (configured for a lolin NodeMCU)
On Visual Studio upload firmware AND filesystem.
at the first start, the wemos use the Wifimanager for configure the Wifi. It create a new Wifi AP 'dimmer', connect on it at 192.168.4.1 and configure your Wifi
sequenceDiagram
Start -->> New Wifi :
New Wifi -->> Configure: 192.198.4.1
Configure -->> Start : wifi configured
Start -->> Run : Open Website and Dim
You can update your firmware directly by the url /update it's open OTA web page, and you can push the firmware or filesystem.
for generating firmware, on Visualstudio/ plateform IO, use the build option the build firmware is stored at .pio\build\d1_mini\firmware.elf folder
You can control the power by an HTTP request :
Control : http://IP/?POWER=xx the max power limit is configured on the config.html page
sequenceDiagram
Website -->> Dimmer : ?POWER=x
Dimmer -->> Website : Apply
you can send the command by you domotic server or your pv router
You can control directly the dimmer with this PV router code https://github.com/xlyric/pv-router-esp32
It use this pv routeur,
The board was sold by a French Association ( APPER ) and a TTGO Tdisplay, A SCT013-30 and AC12 power supply need to be bought separatly
The board is open source and freely for non commercial usage.
You can now chaine multiple dimmers 2 options : equal : send the same command to the other dimmer delest (surplus) : send command to the other dimmer when the maximum power is reached on the first dimmer.
You can use dallas 18b20 Probe for limit the temperature of your water tank the limit temp configuration is on /config.html page.
if you need a password for connect to your mosquitto (MQTT) serveur, the information of connection is in the file config.h
with actual version of arduino GUI or VS, the librairie not working ( memory problem ) I modify the librairie and is called in the lib_deps variable lib_deps = https://github.com/xlyric/RBDDimmer
and called by plateformio.ini file
on a test plate, solder the long female pin from your Wemos D1 mini
( I cut the 3rd pin ( RX ) I use the place for GND connector )
solder a 5.6kOhms resistance between 3.3V hole ( first hole ) and D2 ( last hole ) and sold 3.3V - GND and D2 to your Dallas 18b20 or add connector
you can now connect the board to the main board
A printed Board look like this