Inappropriate ioctl for device (error 25)


#1

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)


#2

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


#3

Fixed in v2.2.4. Please update Atom packages. See https://github.com/platformio/platformio-atom-ide/releases/tag/v2.2.4


#4

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?


#5

“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.


#6

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


#7

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.


#8

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)


#9

Any updates on this?


#10

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