fajar
Hello, Thank you for making OpenPLC, right now I am working on my undergraduate thesis. Actually i'm really new to this automation system world. i wonder if it possible if i use 2 ESP32 on a project? One ESP32 as expansion modules
 
I would like to ask how to configure the other ESP32 as expansion modules. I want to know how i supposed to fill the IP address section. How do i know the IP address? If i upload the dummy program on one of the slave expansion as on the example video on youtube, is it just to activate the Modbus TCP communication? If the 2 ESP32 on the same IP address on TCP is it automatically connected?
So how do i activate the wifi module on esp32 from openPLC?
 
Thank you, i would really appreciate your help on this one
 
[203128%2F9077749%2Fmceclip0]
Reply 0 0
thiagoralves
  1. Upload the dummy program to both ESP32
  2. On the upload dialog, enable Modbus/TCP over WiFi.
  3. Insert your WiFi credentials and define an IP address for each of the slaves. You cannot have them with the same IP address as that will cause a conflict on your network. The IP address must generally have the same first 3 octets as your computer (i.e. 192.168.1) where you just define the last octet to be something different. These octets are like country.state.city.street of a house address. Devices in different “countries”, “states” or “cities” are usually “out of range” and can’t talk. They must be on the same “country”, “state” and “city”, just on different “streets”.
  4. After programming both, add each one of them as a slave on the OpenPLC Runtime.
  5. The number of coils, registers, etc must be equivalent to the number of I/Os you have on your device (see I/O Config tab on the upload dialog).
  6. As a rule of thumb: coils are digital outputs, input status are digital inputs, holding registers are analog outputs, and input registers are analog inputs. They all start at Modbus address 0 and their size depends on the number of pins allocated to each one of them on the I/O Config screen during upload of the dummy code.
Reply 0 0
fajar
is it possible to do it only through OpenPLC editor instead of OpenPLC runtime? i'm having some difficulties running the runtime. if yes, do i only need to configure the IP, wifi SSID and password? how about the MAC, gateway, dns, and subnet? thanks a lot[203128%2F9187595%2Fmceclip0]
Reply 0 0
fg71
If you look in the source code you will understand there are many ways to configure WiFi connection with Arduino compatible board. To make sure most of this boards will work with OpenPLC @thiagoralves need to do a lot of if/else statement. It could be your board do not use MAC to configure the board but other boards it does. When I configure my Nano Esp32 board in Arduino IDE I do not use MAC, DNS, Gateway and still could use it as client/server.
 
In other words the only configuration I do is to make sure my board could connect to my Router and its my Router that give me the IP. If that is not what I want I could also configure a static IP in that case I configure with MAC, DNS, Gateway and Subnet.
 
So to answer your question it depends what board you are using and the Arduino libraries.
 
I only need SSID and PASSWORD because my Router always give me the same IP for my Nano board In your case I do not know what Router you are using or how it configure, but I guess it would be easy to check if you login to your Router and get the IP for your board.
 
ex.
 
[203128%2F9187636%2Fmceclip0]
Reply 0 0
thiagoralves
You cannot add an ESP32 as a slave of another ESP32. Microcontrollers are Modbus slaves only, they cannot be Modbus masters on OpenPLC. So if you want to have two ESP32 linked, you will need to use the Linux runtime on a Raspberry Pi or the Windows runtime on your PC. Through that runtime you can add slave devices, which could be your two ESP32 devices.
 
The network configuration of your ESP32 depends on your network. If you leave everything blank, it will use DHCP to automatically get an IP. Otherwise, you will have to manually set everything.
Reply 0 0
Reply