kostasvit
First of all I would like to thank you for the great software and of course the knowlegde that you provide to us. After the update I am facing an issue with libraries when I try to compile my program. I work on Monterey 12.7.6 with the Openplc editor 3.0 release 2024.12.11 .
Host architecture: 64bit
Processor: i386
Logical CPU cores: 4
Operating system: Darwin
Physical CPU cores: 2
CPU frequency: 2700.00 MHz
CPU model: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz

active PATH Variable:
/usr/bin:/bin:/usr/sbin:/sbin

[/CODE]nbsp;/Applications/OpenPLC Editor.app/Contents/Resources/editor/arduino/bin/iec2c_mac -v
matiec version 0.1
changeset id:
$? = 0
[CODE]
nbsp;/Applications/OpenPLC Editor.app/Contents/Resources/editor/arduino/bin/arduino-cli-mac --no-color version
arduino-cli  Version: 1.0.3 Commit: 8b6ad258 Date: 2024-07-23T08:45:20Z
$? = 0
Checking Core and Board installation...
Core arduino:avr is installed

Checking required libraries...
[CODE][/CODE]nbsp;/Applications/OpenPLC Editor.app/Contents/Resources/editor/arduino/bin/arduino-cli-mac --no-color lib update-index

Downloading index: library_index.tar.bz2 0 B / 3.18 MiB    0.00%
Downloading index: library_index.tar.bz2 942.11 KiB / 3.18 MiB   28.91%
Downloading index: library_index.tar.bz2 2.06 MiB / 3.18 MiB   64.62%
Downloading index: library_index.tar.bz2 downloaded
$? = 0
Installing 20 missing libraries
Installing library: WiFiNINA
Installing library: Ethernet
Installing library: Arduino_MachineControl
Installing library: Arduino_EdgeControl
Installing library: OneWire
Installing library: DallasTemperature
Installing library: P1AM
Installing library: CONTROLLINO
Installing library: PubSubClient
Installing library: ArduinoJson
Installing library: ArduinoMqttClient
Installing library: RP2040_PWM
Installing library: AVR_PWM
Installing library: megaAVR_PWM
Installing library: SAMD_PWM
Installing library: SAMDUE_PWM
Installing library: Portenta_H7_PWM
Installing library: CAN
Installing library: STM32_CAN
Installing library: STM32_PWM
Failed to install 20 libraries: WiFiNINA, Ethernet, Arduino_MachineControl, Arduino_EdgeControl, OneWire, DallasTemperature, P1AM, CONTROLLINO, PubSubClient, ArduinoJson, ArduinoMqttClient, RP2040_PWM, AVR_PWM, megaAVR_PWM, SAMD_PWM, SAMDUE_PWM, Portenta_H7_PWM, CAN, STM32_CAN, STM32_PWM
And this the fail
Reply 0 0
Joluxer
Update: I removed all CB_READONLY from the dropdown menus at ArduinoUploadDialog.py and it worked. Not sure this is the best approach. Maybe you can take a look later.
Ok, again, thanks for testing. I was not attentive enough when I did the search and replace. Eventually two lines got a ChangeValue() call, where SetValue() call was the intended one. The combo boxes are/were CB_READONLY by my intent, as then the preset selections only can be selected by the user. If this restriction is too strict for some combo boxes, then we should release this property again for certain combo boxes - aka omit CB_READONLY - and carry out the pre-assignment from the settings with ChangeValue().
 
My ComboBoxe candidates for keeping the CB_READONLY attribute are:
  • board type selection
  • build options
  • MODBUS RTU serial interface (to be discussed)
  • MODBUS RTU baud rate (not really debatable, there is a fixed set of baudrates)
  • MODBUS TCP network interface
My candidates for omitting the CB_READONLY attribute are:
  • COM port programming the board
I'd like to get your feedback on this. ComboBoxes without the attribute CB_READONLY can be edited by the user and can receive basically free text, those with this attribute active offer the programmed set of options and no free alternatives. Different methods for setting the saved values need to be used - which finally will be my job to be done right.
Reply 0 0
Joluxer
it seems that the process is erroring out, but the output of stderr is not being printed
I cannot reproduce this yet and I have no good clue, how to get closer on this issue. Input is welcome.
@ThiagoAlves: What is your opinion? Should I further try to catch the problem of stderr redirection on Windows when calling Arduino CLI or should I put my effort into exploring Arduino RPC control for builds? I consider the latter as the future for the OpenPLC Editor, especially for the Atom based platform.
 
There are libraries and reference implementation available for both, Python and Javascript. The Arduino IDE is using this for controlling builds and uploads with much success and very performant, as fg71 correctly wrote.
 
Regards, JoLuxer
Reply 0 0
thiagoralves
Sorry for taking so long to respond @Joluxer . Let me check this again now that the PRs were merged and I'll get back to you. If this is still a problem, we might need to dig further. It is weird that the problem only happens on Windows. I had the impression that the process was just outputting an error that wasn't being printed and exiting early.
 
Arduino RCP seems interesting. I'll take a better look at that as we rebuild the Arduino compilation process on the new editor. I don't think it is worth implementing it on Python as I want to reduce the Python dependencies on the new editor to the bare minimum.
Reply 0 0
Joluxer
Arduino RCP seems interesting. I'll take a better look at that as we rebuild the Arduino compilation process on the new editor. I don't think it is worth implementing it on Python as I want to reduce the Python dependencies on the new editor to the bare minimum.
Yes, I see the point and agree, we want to leave the python path and thus reduce the effort going into this. My offer goes more into the direction of technology exploration, so we get the necessary experience with this. That is also the - still unmentioned - reason, why I would start out parts of my tests using the javascript libraries for that and in parallel perhaps some python testing. The latter could lead to use the new generation of build server technology also on the maintenance path of the Python-based generation of OpenPLC Editor. Especially on Windows it is always a kind of adventure, to control external processes by mechanisms, that have their heritage from POSIX systems, such as with our Python-based builder. Engaging the Arduino RPC we use all the I/O redirection stuff, that is maintained by the Arduino Core development team and use the network transport for our text IO into the builder output strategy, which tunnels this into the output window.
 
On the other hand I'm still so impressed with the MCU PLC stuff, that I can commit to the maintenance of the python-based OpenPLC Editor generation and I'm heavily interested to share my current changes and improvements of the MCU stuff and future enhancements too. Eventually I'm also heavily interested in the maintenance and improvment of the MCU part of the O'PLC ecosystem. The Editor is an important vehicle (namely it is the building tool) for this, so I'm willing to maintain the builder and the MCU stuff together.
 
If you want to explore the Arduino RPC server on your own, that is fine for me.
 
If I do parts of this exploration, I would reproduce in Javascript the interface, that we know from the python builder. Perhaps I would show in an standalone demonstrator, how the integration could be done. Then I would share my results as an offer, how the builder control could be done. To some degree we will need to extend the existing builder interface for better performance and to pay for the new technology, e.g. we would need to start the server in advance, we could check dependencies and libraries in advance and other things.
Conversely, I could also take the interface definition from you or from the new generation of the O'PLC editor and develop the new or old builder stuff in relation to it. This would make it easier to build on new architectures and work with potential plugin systems for extensions etc. Contribution and collaboration are usually based on careful agreements and the fulfillment of interface definitions. I'm really curious so see what you prefer.
Best regards, JoLuxer
Reply 0 0
thiagoralves
I think it is worth exploring the Arduino RPC mechanism, and see if it works better than just calling the arduino-cli binary. I still haven't had the time to explore it much myself. If you are willing to create a demo code that interfaces it, that would be great. Either in javascript or in Python on the old editor, either way works fine. Just to prove the concept of using it instead of redirecting stdout/stderr.
Reply 0 0
Write a reply...
Reply