понедельник, 2 декабря 2013 г.

Talking to Arduino from Netgear Stora via USB

Weeks of investigations and code compiling and finally I found that the answer is quite simple and elegant.

  • Download original(or whatever is installed in your Stora) Kernel source. Original one can be found here http://www.openstora.com/wiki/index.php?title=Source_Code
  • Extract kernel sources from stora sources.
  • (Optional - depends on compiler that you have) I had gcc from optware ipkg installation, so I had to change the Makefile - otherwise 'make menuconfig' will tell you that mixed explicit and implicit rules.
    • Locate all places where you see something like this "$somthing: something:"
    • Split each variable before colon into the separate line and duplicate code from one into the empty one.
    • Run 'make menuconfig' if there is still "mixed implicit...bla-bla-bla" error - check the line number and do the separation trick above again
  • Run 'make menuconfig'. Do no uncheck anything(you need the kernel in it original configuration) - you need to enable experimental drivers/code (because ftdi_sio is expiremental in Stora code) and then go to drivers > USB > USB serial, enable generic and core usbserial drivers as well as FTDI driver (ftdi_sio), close and save the config
  • Run 'make modules ARCH=arm'
  • Copy usbserial.ko and ftdi_sio.ko where you store other drivers.
  • I think I also added both drivers into modules.conf or whatever is the procedure for device drivers, 'depmod -a', you know... :) this kind of stuff
  • Also I did the trick with udev rules (http://playground.arduino.cc/Linux/All), but I'm not sure it was necessary.
  • Plugin the arduino board - do modprobe usbserial, ftdi_sio if necessary (if they are not loaded already) and here you go... you can talk to arduino(it was /ttyUSB0 in my case)
P.S. After everything worked I was using screen command to test everything - it works very well with my ardu. But you can find other examples(http://playground.arduino.cc/Interfacing/LinuxTTY)

Комментариев нет:

Отправить комментарий