Connect OPTA Wifi to Arduino IoT Cloud

Hi everyone,

After struggling for +10 hours to connect the Arduino OPTA to the Arduino Cloud, I want to give some help to you, future OPTA strugglers.

Part of this is a combination of multiple posts modified with some details relevant to me :

So, first of all, check your Arduino MBED OS OPTA version, which needs to be 4.1.6 : you can check it here : C:\Users\(yourname)\AppData\Local\T and open sketch.yaml with text editor. Then go to the end of the script, you will find this :

opta_1.2.0:
fqbn: arduino:mbed_opta:opta
platforms:
- platform: arduino:mbed_opta (4.1.6)
libraries:
- AlPlc_Opta (1.2.0)
- ArduinoRS485 (1.0.5)
- Arduino_Opta_Blueprint (0.2.2)
- Arduino_SerialUpdater (0.0.1)
- Arduino_DebugUtils (1.4.0)

UserLibsHere

If the MBED_ OPTA version is not like this, please change it, then save the .txt file and close it.

Next, download this, extract, and open the .ino file in the Arduino IDE 2.3.6 (latest as of today) :

opta_memory_partitioning.zip (62.8 KB)

Connect your OPTA via USB to your computer, then :

(jose01’s answer with my modifications)

  • Unzip the contents and place both files (the sketch and the certificate) in the same folder.

  • Open the .ino sketch using Arduino IDE version 2.3.6.

  • If multiple COM ports appear (due to previous attempts using PLC IDE),
    Select the port with the lower number (e.g., COM11) to upload the sketch.

  • Upload the sketch without making any changes.

  • Once uploaded, open the Serial Monitor, baudrate 9600.

  • Do not type anything. Wait until the following message is displayed:

It's now safe to reboot or disconnect your board.

  • Open Arduino PLC (!!!) IDE (v1.0.8 in my case) via the example file from Arduino tutorial (named OPTA PLC IDE CLOUD)

    Opta_PLCIDE_Cloud (1).zip (51.7 KB)

  • Go to Sketch tab and put your SSID and PASSWORD between the quotes (“ “)

  • Now go to Librairies and enter manually (yes…) the name and versions of used librairies. BE CAREFUL TO USE THE EXACT SAME VERSIONS ! This mix of libraries is a very sophisticated soup, if you change one version, it will not work anymore (compilation errors). After entering manually, the PLC IDE will download automatically the librairies when you will compile the code.

  • Now just find the Other section without doing nothing. you can find it here :

  • Double-tap very quickly the reset button on the Opta using a clip or pen tip, the green LED above the reset button should start blinking slowly (like breathing).

  • In PLC IDE, go to Project > Refresh Current Target to update the available ports list

  • image

    Select the COM port available, then click Download. Wait for it to finish (it is long).

  • A new COM port (example : COM12) will become available. You will have now 2 COM ports.

  • GOOD TO KNOW : lowest port is used to DOWNLOAD firmware TO the PLC, highest port is used to CONNECT to the PLC for live monitoring and DOWNLOAD code to the PLC.

  • Once the runtime is successfully installed, go to Online > Setup Communication.

  • Select the COM port with the HIGHER number (e.g., COM13) and click OK.

  • Then proceed to click here

  • You should now be connected ! Then, go back to Configuration - OPTA - Device info, you will see in STATUS block something named “Activate license”, click this button. Wait for it to finish, then unplug your OPTA and connect it back.

  • In PLC IDE, go to Project > Refresh Current Target to update the available ports list

  • Connect again by clicking the plug button (Connect to the target)

  • All lights should be green

  • So first connection and activation of the license is now done

  • Go to the Arduino Cloud web interface, add a thing and create the dashboard etc by following this : (from arduino website)

  • First go to DEVICE, select ADD, ARDUINO OFFICIAL BOARD, and then connect via SERIAL

  • Use the lowest com port if 2 of them are shown. Follow the tutorial. Device should be ONLINE now

    • Then create your thing

      To learn more about how to use the Arduino Cloud, please take a look at Getting Started With the Arduino Cloud tutorial.

      The following Cloud variables will be created:

      Cloud Variables Type Variable Permission Send Values
      analog01 Float (0 - 65535) Read Only On change
      counter Integer (0 - 2500) Read Only On change
      cloudButton Boolean Read & Write On change
  • Then create the dashboard and link the variable from your widgets to the variable creating in the Thing (very easy, just follow and tinker the app)

    • Important : do not try to upload the sketch from Arduino IOT CLOUD web interface, use only PLC IDE. OTA (over the air) updates are not working either.
  • Nothing is working at the moment, so you need to go back to the ARDUINO PLC IDE

  • In PLC IDE, go to Project > Refresh Current Target to update the available ports list

  • go to Online > Setup Communication. Click Modbus, properties

  • Select the COM port with the HIGHER number and click OK.

  • When your are connected, you will see in the right lower side of the screen '“CONNECTED” but also a blue “NO CODE”. To solve this, we need to send the code to the PLC. So click this button

  • Not working, or fails to upload with error exit status 74 ? Wait !

  • Try to click on HALT

  • help 7

  • And then try again '“send code to PLC” but read next step carefully :

  • Now when you see the message as in next picture, you need to click the RESET button very quickly TWO TIMES ! to send the OPTA in DFU mode and continue the downloading

  • Then download is processing, and is working, wait for it to finish

  • Unplug your OPTA, plug it back, try again to connect and you should see this :

  • SOURCE OK

  • Now check your dashboards on the Arduino IOT CLOUD app, it should be LIVE with moving values and the blue LED switch working !

I don’t know for how long it will work, but it works as of now. It is only the beginning and it has been a nightmare. Good luck everyone, and thanks to everyone who left answers in the past, it helped me a lot !

If something is not clear, please ask. Also, do not even try to put newer librairies on the PLC IDE, it is a nightmare to find a good match between all of them. This is the best I could do after trying dozens of time.

Anyway, if you feel limited by using the PLC IDE, feel free to use the Arduino IDE (the classic one, only structured code), you will have more possibilities (even OTA and updates from Arduino Cloud web interface should work)

Thanks everyone, this tutorial was quick and dirty but hey the informations are here, cheers from France!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.