Inappropriate ioctl for device (error 25)

I’m using atom on kubuntu os. I can get everything to work and it builds, and then I can go to serial monitor and see the output, but if I select “build and monitor” (instead of just build or just upload) I will get that error (inappropriate ioctl). I’m using latest atom and latest platformio and 18.04 LTS ubuntu.

So as long as I don’t want to upload and then automatically see the serial output it works fine, but 99% of the time when I upload I want to see the serial automatically so this is probably a bug. I had windows 10 before and didn’t get this issue on that OS.

I tried doing a bunch of searching online and tried some different solutions but nothing has worked yet. I did chmod and made sure the ttyAMC0 (or something like that) has permissions.

Any other ideas?

(below says it is solved but it is 100% not solved, dont be fooled)

I tried sudo /usr/(iforget)/atom but that didn’t change the issue.

Fixed in v2.2.4. Please update Atom packages. See Release 2.2.4 · platformio/platformio-atom-ide · GitHub

The merge in the link you provided says that you removed “upload and monitor” option. Are you trying to be funny by saying you fixed it by removing the option to use it or are you being serious?

“Upload & Monitor” task was added VSCode in September. VSCode uses full working terminal to run the tasks. Atom uses Node.JS process spawning. Serial Monitor does not work in this case.

You can use PlatformIO Terminal for Atom and manually type pio run -t upload -t monitor. In this case, it will work in Atom too.

it works just fine on my windows box, i’m not sure what you’re on about.

Just so you know what im saying, on my windows laptop using atom and platform io with my arudino mega, I can do upload + monitor option and it works fine. On my new ubuntu desktop using atom + platform io with my arduino mega, i cant do upload + monitor because it gives that 25 error.

Okay so apparently you pushed an update to remove upload + monitor, so I blocked updates on the windows box to not allow that to happen there, but on my ubuntu box (which upload + monitor is now gone) upload works, however monitor now gives the same error:

platformio device monitor
Error: (25, ‘Inappropriate ioctl for device’)

so on my linux box I can use atom to write code, platform IO to upload the code, and arduino ide to use the serial monitor (because the serial monitor works just fine in arudino ide)

Any updates on this?

We use PySerial’s “minitem” which does not work in Node.JS subprocess. Atom Build extension uses Node.JS subprocess to run a task.

You can call manually in PlatformIO IDE for Atom 's Terminal this

pio run -t upload -t monitor

Hello,
Exact same error launching monitor from CLion platformio menu, fresh install on Ubuntu 18.04. It does work using CLion embedded terminal or system bash. As far as I know, jetbrains plugin are tied to the JVM, not Node.JS.
BTW thanks for your great work !

Hi,
enable ‘use.tty.for.external.tools’ in the ‘Registry…’ Options of CLion solved this (an other Tools which needs ‘real’ Terminal Support).

1 Like