Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-11 Thread Joerg Wunsch
As Anton Smirnov wrote: avrdude: ser_setspeed(): tcgetattr() failedavrdude: ser_open(): can't set attributes for device /dev/bus/usb/002/002: Not a typewriter That cannot work. What is the reason of error? You need a serial emulation device. Depending on your operating system, the pathname

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-11 Thread Anton Smirnov
That cannot work. As i said file descriptor is used, file path is used only for message (agree that's misleading, path is passed to avrdude too). How can i understand what type of file descriptor is returned since i can't find explanation in UsbDeviceConnection,getFileDescriptor() description

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-11 Thread Joerg Wunsch
As Anton Smirnov wrote: /dev/bus/usb devices cannot be used directly for STK500v2. All this relates to Android. I'm not using file path (see above), but file descriptor passed from android app. But how is that file descriptor obtained, i.e. which pathname has been provided to open()

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-11 Thread Anton Smirnov
2013/6/11 Joerg Wunsch j...@uriah.heep.sax.de As Anton Smirnov wrote: /dev/bus/usb devices cannot be used directly for STK500v2. All this relates to Android. I'm not using file path (see above), but file descriptor passed from android app. But how is that file descriptor obtained,

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-11 Thread Joerg Wunsch
As Anton Smirnov wrote: Only the underlying driver knows how to e.g. talk to the serial emulation device at the other end of the USB in order to adjust baudrates, control signals etc. Okay, so now the question is what is this file descriptor and how can it be used in native code. Even

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-11 Thread Anton Smirnov
2013/6/11 Joerg Wunsch j...@uriah.heep.sax.de As Anton Smirnov wrote: Only the underlying driver knows how to e.g. talk to the serial emulation device at the other end of the USB in order to adjust baudrates, control signals etc. Okay, so now the question is what is this file

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-11 Thread Joerg Wunsch
As Anton Smirnov wrote: You'd end up in reimplementing (parts of) a serial device emulation in AVRDUDE. I don't think this is a useful approach. Okay, i've been thinking about it, but it seems to be pretty difficult for me. There's no uniform handling for this. If the backend implements

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-11 Thread Anton Smirnov
Sure, i know that there are different kinds of Arduino boards: Arduino Uno implements CDC and Arduino Nano f.e. uses FTDI-chips. I know how to detect it's kind and i can pass the type to avrdude. So we can think the detection is not the problem. I've been thinking that android os does it

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-11 Thread Joerg Wunsch
As Anton Smirnov wrote: The main problem now i think is to understand what is this file descriptor nature sincestandard posix impl can't work with it. As I said: you have to reimplement a virtual serial port driver on top of it. The descriptor is only useful to transmit/receive URBs through

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-11 Thread Anton Smirnov
i've created android bug issue and received an answer android android engineers: https://code.google.com/p/android/issues/detail?id=56450 please add your comments or right questions about expected file descriptor or smth 2013/6/11 Anton Smirnov d...@antonsmirnov.name Okay, then i don't

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-11 Thread Axel Wachtler
Sorry for jumping in, I just roughly followed the discussion, but might this be the missing software part: http://code.google.com/p/usb-serial-for-android/ ? Axel. On 11.06.2013 12:19, Anton Smirnov wrote: i've created android bug issue and received an answer android android engineers:

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-11 Thread Joerg Wunsch
As Axel Wachtler wrote: Sorry for jumping in, I just roughly followed the discussion, but might this be the missing software part: http://code.google.com/p/usb-serial-for-android/ ? To me, it very much looks like that, yes. The main difference is that it needs its own method to set

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-10 Thread Joerg Wunsch
As Anton Smirnov wrote: I'm getting file descriptor for usb device on android, grant permissions and pass usb device file descriptor to avrdude process and getting Now a typewriter error in ser_posix while trying to set baud rate. What kind of programmer? Most USB-connected programmers in

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-10 Thread Anton Smirnov
Not sure actually. This relates to Arduino boards and they have bootloader which talks over USB using stk500v1/v2 and uploads firmware itself. So no hardware programmer is required. 2013/6/10 Joerg Wunsch j...@uriah.heep.sax.de As Anton Smirnov wrote: I'm getting file descriptor for usb

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-10 Thread Joerg Wunsch
As Anton Smirnov wrote: This relates to Arduino boards and they have bootloader which talks over USB using stk500v1/v2 and uploads firmware itself. OK, they indeed use a serial device emulation. If you get an ENOTTY on setting the baudrate, it would mean your driver (the part of the operating

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-10 Thread Anton Smirnov
Probably that was pretty unclear. I modified avrdude 5_11_0 sources in order to: 1. receive additional parameter (socket address) in command-line 2. read file descriptor from the socket using socket address 3. set file descriptor to union filedescriptor 4. use it in serial_open instead of

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-10 Thread Joerg Wunsch
As Anton Smirnov wrote: is there any work around for it (without rooting)? Frankly: I don't know. Depending on your Arduino platform, setting the baudrate might be required or not. If it's not required (e.g. since the STK500v2 protocol is handled by a controller directly attached to USB, I've

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-10 Thread Anton Smirnov
2013/6/10 Joerg Wunsch j...@uriah.heep.sax.de As Anton Smirnov wrote: is there any work around for it (without rooting)? Frankly: I don't know. Can you say what is required (compile params, flags, etc..) exactly? I think i will have to ask for it from android engineers or smth.

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-10 Thread Joerg Wunsch
As Anton Smirnov wrote: Frankly: I don't know. Can you say what is required (compile params, flags, etc..) exactly? I think i will have to ask for it from android engineers or smth. It's the POSIX (“Single UNIX Specification”, SUS) API calls tcgetattr()/tcsetattr(), in whatever way they

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-10 Thread Anton Smirnov
Okay, thanks for the explanation. 2013/6/10 Joerg Wunsch j...@uriah.heep.sax.de As Anton Smirnov wrote: Frankly: I don't know. Can you say what is required (compile params, flags, etc..) exactly? I think i will have to ask for it from android engineers or smth. It's the POSIX

Re: [avrdude-dev] “Not a typewriter” avrdude error on Android

2013-06-10 Thread Joerg Wunsch
As Anton Smirnov wrote: Okay, since i'm completely in stuck with it i have to try just comment/remove isatty() check. That's simple enough. Let's hope the remainder does work. Do you think i have to just pass file descriptor as int and just skip using socket? You could give it a try.