YvesDMG
Hello
after over 1 year I needed to change my OpenPLC programs due to a WLAN changes.
With the newly installed OpenPLC from 20240129 I cant get the program to download to the devices.
The Arduino IDE 2.2.1 is installed and working.
The COM port for uploading is correctly selected

Observations
1) The Transfer dialog shows the device as"ESP8266 D1-mini [NOT INSTALLED]" - i.e. only one devices shows as installed.2) Uploading program to Arduino board at None...
2) Uploading of the compiled program fails with:
.....Uploading program to Arduino board at None...
...A fatal esptool.py error occurred: could not open port 'None': FileNotFoundError(2, 'Das System kann die angegebene Datei nicht finden.', None, 2)esptool.py v3.0
...Serial port None
...New upload port: None (serial).
- the full log is in the attachment.
 
I hope that somebody can give me a hint how to fix this as I'm stuck with a manual heating control now ;-)
Regards, Yves
Reply 0 0
thiagoralves
Make sure you've selected the right COM port before starting the upload process. The [NOT INSTALLED] item is not a problem. It will automatically install during the upload process.
Reply 0 0
YvesDMG
thank you very much for the quick reply.
In fact, the issue was related to the serial port: I connected the device while the transfer dialog was already open, but before launching the transfer.

However, when connecting the device before opening, the transfer dialog it works fine.
 
What I find strange: when OpenPLC checks the existing of the HW files, it finds that they are already installed, but will check them again at every subsequent transfer.

Thanks again, kind regards
Yves
Reply 0 0
thiagoralves
Something might be preventing OpenPLC from writing that information in the configuration file. It checks if the board files are present during first upload. If they are it writes what version of board files are installed, which in turns replaces the [NOT INSTALLED] by the version number. This information is located at the JSON file on /editor/arduino/examples/Baremetal/hals.json
Reply 0 0
Pedro Constantino
Something might be preventing OpenPLC from writing that information in the configuration file. It checks if the board files are present during first upload. If they are it writes what version of board files are installed, which in turns replaces the [NOT INSTALLED] by the version number. This information is located at the JSON file on /editor/arduino/examples/Baremetal/hals.json
Hello,
 
yesterday I installed openPLC on Windows 11.  I use an Arduino Uno and an Arduino Due.  The Arduino IDE is the most recent 2.3.x installation.  I run the simple blink test.  I followed the instructions in the videos provided by Thiago Alves.  These videos are very good and suited to help a novice like me.
 
My first issue: whatever I choose, the "Transfer Program to PLC" command does not recognize that it was already downloaded.  I ensured the Arduinos were connected to the PC before starting the openPLC Editor.  And I also know which COM-Ports to select.  Independently from the Arduino I use, I get the following message: "Support for arduino:avr:uno [or: for the arduino😃ue] is not installed on OpenPLC Editor [even though the files had been downloaded in the previous run]. Please be patient and wait while arduino:avr:uno is being installed... Config file already exists, use --overwrite to discard the existing one."  Any hint how to make the openPLC Editor aware that the files had been downloaded before?
My second issue: with Arduino Uno I get the Blink program up and running.  Everything is fine.  Port 13 is set and reset using %Q0.3.  For the Arduino Due, I have to use port 27, refer to https://content.arduino.cc/assets/A000056-full-pinout.pdf, seen today.  In the openPLC documentation, the ports shall be the same for the Due and for the MKR devices, https://autonomylogic.com/docs/2-4-physical-addressing/, seen today.  I expect that port 27 is mapped to %Q1.2.  However, the blink test does not make the LED blink, as before with the Uno.  My question: what do I have to modity in openPLC to map the ports correctly?
 
Regards,
Pedro.
Reply 0 0
thiagoralves
For your second issue, maybe the easiest way to test would be to modify the IO configuration on the upload dialog. Put pin 27 first on the digital outputs, then you can use %QX0.0 to blink the LED.
Reply 0 0
Pedro Constantino
Unfortunately, placing pin 27 as first number in the "Digital Outputs" line and using %QX0.0 did not make the LED blink.  Comment: in the default setting, pin 27 appears in position 10, which should be addressable as %QX1.2.  Do you have further ideas?  Regards Pedro.
Reply 0 0
thiagoralves
I finally opened the PDF you refer to on the arduino stuff and understood your confusion. You should use pin 13 for the built in LED, not 27. PB27 is the internal name for the pin. OpenPLC uses Arduino pin numbers.
Reply 0 0
Pedro Constantino
Ah!  Thank you for the information.  This information is important.  Hence, the reference for defining pin numbers correctly is the schematic of the Due board, which I found here: https://content.arduino.cc/assets/ArduinoDUE_V02g_sch.pdf.  The µC used on the Due board has a pin PB27.  And this pin is connected to a wire which has the signal name PWM13.  Okay.
 
However, in the openPLC's default configuration, the pin 13 (I would rather name it to be the "signal on the Due board, see schematics") belongs to the group of "Analog Outputs".  Which takes me into a more general question: I personally consider PWM outputs to be digital outputs, not analog outputs.  Or does openPLC use a certain convention which considers PWM outputs to be analog outputs?  (Because you can use PWM outputs to also generate quasi analog signals, if the PWM frequency is high and the contained fundamental wave component has a comparatively low frequency...  And you also write a time value to the register, which is rather an analog than digital value, even though that the associated physical pin is a digital pin with only two states.)
 
If pin 13 is correctly assigned to be an analog output, then how should I access the output to be on or off, to make the led blink?  Only in the sense of "completely on" or "completely off"?  Or can I pwm the led with the Due?
 
Regards, Pedro.
PS: You do a tremendous job, Thiago!
Reply 0 0
Pedro Constantino
Success! Good morning, I deleted "13" in the analog output field and added the "13" as first entry in the "digital outputs".  Using %Q0.0, the led now blinks.  My question: is there an instruction how to correctly assign the DIO and AIO pins for openPLC?  Regards, Pedro.
Reply 0 0
thiagoralves
You can use any pin as digital input or output. For analog output the pin must be marked as PWM capable. For analog input the pin must have ADC capability.
Reply 0 0
Pedro Constantino
Thank you for the answer.  And I stay tuned.  Maybe you can resolve the first issue, with an upcoming update :-).  Regards Pedro.
Reply 0 0
Reply