# IOT2000: Arduino support?

**URL:** <https://forums.balena.io/t/iot2000-arduino-support/4373>\
**Category:** balenaOS\
**Created:** [November 9, 2018, 2:12pm UTC](https://forums.balena.io/t/iot2000-arduino-support/4373 "2018-11-09T14:12:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![edorgeville](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/edorgeville/32/3993_2.png) [@edorgeville](https://forums.balena.io/u/edorgeville)\
**Post date:** [November 9, 2018, 2:12pm UTC](https://forums.balena.io/t/iot2000-arduino-support/4373/1 "2018-11-09T14:12:16Z")

</div>

Hi,  
I am sending a message here after posting on the Github issues of the repo, as those forums are more active 😉

> <https://github.com/balena-os/balena-iot2000/issues/19>

A major feature of the IOT2020/2040 is to run Arduino programs alongside Linux.  
Deploying such programs is done by flashing the example image onto the microSD card and booting, then using the MicroUSB port on the device, selecting the right COM port in the Arduino IDE and using the “Upload” button.  
Unfortunately, when using the BalenaOS/ResinOS image (either from the cloud panel or the homepage), the IOT2020 won’t show up in both the Arduino IDE and Windows Device Manager.  
Is Arduino supported? If not, is it a planned feature? We are trying out BalenaOS as a replacement to the base image but Arduino support is a must have.  
Cheers!

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [November 9, 2018, 5:31pm UTC](https://forums.balena.io/t/iot2000-arduino-support/4373/2 "2018-11-09T17:31:27Z")

</div>

Hi, the Arduino feature as you have mentioned is not supported. It sounds from your explanation, that it needs a special OS for that to work (as booting from that SD card).

Found some posts regarding this feature, and looks interesting: [Tutorial - Program the IOT2000 with Arduino IDE!](https://support.industry.siemens.com/tf/ww/en/posts/tutorial-program-the-iot2000-with-arduino-ide/164153/?page=0&pageSize=10)

Not entirely sure how that feature would combine with the way balenaOS is set up (in terms of how to get the software on the device, and how to run it), we’d need to look into this.

Looking at the tutorial, the IoT2000 might be a Intel Galileo compatible board (or using Galileo inside?), so I’m sure it can be programmed many different ways, and the hardware interfaces should be documented.

Thus, thanks for bringing this to our attention, we’ll have to try it out, In the meantime there’s no Arduino programming support planned for IoT200 with balenaOS. I believe it should be possible to provide similar support by running a specially crafted container on the device, but that’s just a hunch. This is the current status, but let you know if we have anything new regarding this!

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [November 9, 2018, 5:55pm UTC](https://forums.balena.io/t/iot2000-arduino-support/4373/3 "2018-11-09T17:55:50Z")

</div>

Hey @edorgeville was looking into this a bit more, and actually it seems much more feasible than I’ve expected ( knock on wood).

- looking inside Siemens’ example image, it might be possible to replicate that functionality (it looks like only a few tools are involved), and could possibly receive sketches over serial
- also it seems like the Arduino IDE creates Linux executables for the IOT2000 (based on [this forum post](https://communities.intel.com/thread/48813)), so it could be checked in and shipped/deployed to devices by the natural balenaCloud way. This is just a hunch, but would make things interesting.

So there might even be more than one way to do this, catering to more interesting workflows.  
Would recommend checking things out along this path, and as mentioned, we’ll look into this further and let you know if there’s any development!

---

<div class="post-metadata">

**Author:** ![edorgeville](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/edorgeville/32/3993_2.png) [@edorgeville](https://forums.balena.io/u/edorgeville)\
**Post date:** [November 9, 2018, 10:33pm UTC](https://forums.balena.io/t/iot2000-arduino-support/4373/4 "2018-11-09T22:33:20Z")

</div>

Wonderful news!  
I did notice the elf files in the past, didn’t think that would be an executable.  
I will do more digging toward making a Dockerfile running said .elf file.  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![edorgeville](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/edorgeville/32/3993_2.png) [@edorgeville](https://forums.balena.io/u/edorgeville)\
**Post date:** [November 12, 2018, 8:16pm UTC](https://forums.balena.io/t/iot2000-arduino-support/4373/5 "2018-11-12T20:16:21Z")

</div>

This was a waaaaay deeper rabbit hole than I thought 😓  
I tried to understand the structure of the [meta-iot2000 repo](https://github.com/siemens/meta-iot2000) but the whole Yocto ecosystem is still a complete mystery to me after a day and a half of reading.

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [November 13, 2018, 4:40pm UTC](https://forums.balena.io/t/iot2000-arduino-support/4373/6 "2018-11-13T16:40:54Z")

</div>

Hey @edorgeville I would not think the solution will be in `meta-iot2000`, that is the host OS. In my opinion based on the few hours check above, it should all work on the application level, so don’t have to dig into that area at all.

The main thing is I believe:

- creating an application that does the same thing as the Siemens example OS’s Arduino service, just inside a container, or
- check out the files created by the Arduino IDE and check how to ship and run those.

These should be a lot more tractable. No need to go down to the OS level necessarily.

---

<div class="post-metadata">

**Author:** ![edorgeville](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/edorgeville/32/3993_2.png) [@edorgeville](https://forums.balena.io/u/edorgeville)\
**Post date:** [November 13, 2018, 5:34pm UTC](https://forums.balena.io/t/iot2000-arduino-support/4373/7 "2018-11-13T17:34:34Z")

</div>

> [@imrehg](#):
>
> - check out the files created by the Arduino IDE and check how to ship and run those.

I compiled the Blink example from Arduino, here is the elf file in case anyone wants something to test with 🙂 It blinks the USER led on and off.  
[https://gist.github.com/edorgeville/fa4955c3234a6fb05bd67d3f5ecae206](https://gist.github.com/edorgeville/fa4955c3234a6fb05bd67d3f5ecae206)

I tried loading up [resin/iot2000-alpine-buildpack-deps](https://www.balena.io/docs/reference/base-images/base-images/#siemens-iot2000), `chmod +x`’ing the file and running it but I get a `No such file or directory` error.

```bash
$ run -it --rm resin/iot2000-alpine-buildpack-deps /bin/bash

$ wget https://gist.github.com/edorgeville/fa4955c3234a6fb05bd67d3f5ecae206/raw/8dbb019d14a205a47601c20ff7b6cf84b860e624/Blink.ino.elf
$ chmod +x Blink.ino.elf
$ ./Blink.ino.elf
#> bash: ./Blink.ino.elf: No such file or directory

```

I also included a [`readelf -a` output](https://gist.github.com/edorgeville/fa4955c3234a6fb05bd67d3f5ecae206#file-readelf-txt) which I do not understand any of either.

---

<div class="post-metadata">

**Author:** ![zubairlk](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/zubairlk/32/954_2.png) [@zubairlk](https://forums.balena.io/u/zubairlk)\
**Post date:** [November 19, 2018, 9:46am UTC](https://forums.balena.io/t/iot2000-arduino-support/4373/8 "2018-11-19T09:46:47Z")

</div>

Interesting platform.

Its based on the Intel x1000. It might be worthwhile checking the old discontinued Intel Galileo dev board for hints on how to go about doing this.

This should be possible via the Arduino IDE. We need to figure out what is running in the SiemensOS that makes the communication with arduino ide happen. I tried to hunt around and I think the magic happens here

> **[siemens/meta-iot2000](https://github.com/siemens/meta-iot2000/tree/bd0135639babe9f39d33ea6fc8290a1981e6bb95/meta-iot2000-example/recipes-galileo/galileo-target/files)**
>
> SIMATIC IOT2000 Yocto Board Support Package. Contribute to siemens/meta-iot2000 development by creating an account on GitHub.

There is the launcher script with a systemd service.

```auto
      $CLLOADER $CLLOADER_OPTS < /dev/ttyGS0 > /dev/ttyGS0 & clPID=$!

```

Does that line read from /dev/ttyGS0 and then pipe it out to /dev/ttyGS0? Not entire sure what its doing. Reading from Arduino IDE via /dev/ttyGS0 and simultaneously writing to a sketch perhaps?  
Maybe this is the way the clloader utility works

Do you see `/dev/ttyGS0` in the host/app containers?

Regards  
ZubairLK

---

<div class="post-metadata">

**Author:** ![edorgeville](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/edorgeville/32/3993_2.png) [@edorgeville](https://forums.balena.io/u/edorgeville)\
**Post date:** [November 19, 2018, 1:41pm UTC](https://forums.balena.io/t/iot2000-arduino-support/4373/9 "2018-11-19T13:41:22Z")

</div>

> [@zubairlk](#):
>
> ```auto
> $CLLOADER $CLLOADER_OPTS < /dev/ttyGS0 > /dev/ttyGS0 & clPID=$!
> 
> ```
> 
> Does that line read from /dev/ttyGS0 and then pipe it out to /dev/ttyGS0? Not entire sure what its doing.

From what I understand, this would be the output (?), maybe what you’d get from running Serial.print() inside the Arduino program.  
I think clloader does run the Arduino program (sketch) too.

> <https://github.com/siemens/meta-iot2000/blob/1276e31be5563f624544e7c7a9323b8dcda858d5/meta-iot2000-example/recipes-galileo/galileo-target/files/galileo-target/Readme.txt#L13>

* * *

> [@zubairlk](#):
>
> Do you see `/dev/ttyGS0` in the host/app containers?

Not from the host nor from a container. Here’s the output of `ls -la /dev` (character limit wouldn’t let me post it here):

[https://gist.githubusercontent.com/edorgeville/fa4955c3234a6fb05bd67d3f5ecae206/raw/f22e393517c9aa9d61bc1a15c944390e4db09096/dev\_ls.txt](https://gist.githubusercontent.com/edorgeville/fa4955c3234a6fb05bd67d3f5ecae206/raw/f22e393517c9aa9d61bc1a15c944390e4db09096/dev_ls.txt)

Also, let me know if you need access to the host, our unit is not currently in use.
