Openwrt Usb Serial Ftdi

  пятница 15 февраля
      5
Ftdi

Caution: Very few devices have standard RS-232 +/- 12V serial ports, but in many OpenWrt-supported devices the serial ports operate at TTL voltage (sometimes 5V, most often 3.3V) levels, meaning you cannot use a standard serial or USB to serial cable: it will fry your board. Serial Console. Most devices that are supported by OpenWrt include a serial port. These serial ports typically provide a console to the bootloader and, when the firmware has booted, a console to the running system. Typically, a console to the bootloader will allow you.

I have Openwrt router with Arduino connected via USB FTDI adapter. Serial port is /dev/ttyUSB0 Arduino code prints some data: First part of data printed with delay via command print(), for example: Serial.begin(9600); Serial.print(var1); delay(1000); Serial.print(var2); delay(1000); Serial.print(var3); delay(1000); And second part printed with println() command: Serial.println('); Serial.println(var4); Serial.println(var5); Serial.println(var6); So when I open Serial port in terminal I can see something like this: 1 then timeout in 1 sec, then 1 2 next timeout. And then 1 2 3 last timeout and 1 2 3 4 5 6 It works in Terminal program and in console in OpenWRT, for example screen /dev/ttyUSB0 I need make a Lua script that will read Serial port and print the data in the same way. I have a simple script, but it doesn't work as expected.

Rserial=io.open('/dev/ttyUSB0','r') while true do chain = nil while chain==nil do chain=rserial:read(); print(chain) end end it shows all data at once. It doesn't show first 3 vars one by one with delays. Seems it is because of rserial:read() - it will read until it receives a newline character. It stated in similar question: I tried to run this command as was advised there: stty -F /dev/ttyUSB0 -icanon but it doesn't help and I don't understand why. Is it the way to fix this behavior via stty? 7273 Or I definitely need to use another Serial libs for Lua script?

All of these libs seems pretty outdated for now and I don't want to use outdated stuff. From the: When called without formats, it uses a default format that reads the next line (see below). A new line is anything in the buffer until the next newline character.

So as long as you don't send a newline character Lua will wait one as it has been told by calling read() Once a newline character is received you will be prompted any other character in that line. Terminal programs usually update every byte to show what they receive in 'real-time'. So if you want to have the same behaviour you may not use read() without any arguments. Use read(1) to read every single byte without waiting for anything else.

Hi folks, I'm new here and I've quite the same issue I wanna install kmod-usb-serial, kmod-usb-serial-ftdi and've no sucess. I've tried apt-get usb. Dpkg-i i,ve downloaded rar files with ipk. Extensions(some erorr opening/extracting file) and've no success I wanna hack my router firmware: I've serial-usb connection router Pirelli discus AG v1 pc: Lenovo thinkpad r 500, Linux mint13 I've already installed opewrt by this tut can anybody show me some bin file I've found nothnig usefull, searched here, github. And nuthin I've downloaded from here (Last edited by r.balejik on 25 Feb 2013, 10:23). I followed this guide on first login and it says i need some vanilla image and I don't have any image in trunk?

Od I need to download the openwrt imagebuilder on the top of the (I have pirelli ag225 and that's brcmxx I've found brcm63xx most probably) I've downloaded snapshots/trunk = bleeding edge or is it better to download the stable version = backfire my router is wuite old 07/07 so the stable could be ok? And from backfire I've downloaded imagebuilder,sdk and toolchain, is that enough to install openwrt on my pc (Last edited by r.balejik on 28 Feb 2013, 20:36). I'll be damned. I need to do this: ( according to 'officila openwrt' guide ) Any freshly installed 'vanilla' OpenWrt Image, will start with these defaults: The internal interface lan and the wireless interface/interfaces wlan0 / wlan1 are bridged together to br-lan wifi is disabled the IP address of the internal interface/bridge of the OpenWrt-device is 192.168.1.1/24 dnsmasq is running; it allocates IP addresses in the range of 192.168.1.100 to.250 on the internal interface to connected hosts dropbear does not accept connections telnet daemon is running on standard port (23). Change pass for openwrt and then ssh into router.

And finally opkg kmod-usb. And you're saying I need opkg first I'm lost.

Moreover when I type opkg terminal says command not found ( I build opkg from source) so what I need to do first? I'v no file in /etc/opkg.conf.

So am i doing smth wrong? How to install opkg properly.?? (Last edited by r.balejik on 28 Feb 2013, 22:55). My advice as a beginner myself in OpenWRT: If you're new to OpenWRT and/or linux, - forget about compiling an image by yourself - especially forget about compiling a trunk image Both are only suitable for advanced users, who know what they're doing, who do not stumble over every tiny error and who can help themselves. Instead, for the first steps with OpenWRT, go the easy and safe way: Install a *precompiled image* or generate (not compile) one by yourself with help of the image generator. ---> ---> see 1) + 2) To my experience, this is much easier, less error prone and *will work*.