T
T
tayanov2015-08-27 10:18:14
Arduino
tayanov, 2015-08-27 10:18:14

How to execute bash command received in /dev/ttyATH0 from Arduino?

Arduino has a display.
Arduino making a request to OpenWRT to execute the script ./root/to.sh

#!/bin/sh
#weather string 

URL='http://www.accuweather.com/en/ru/maykop/291658/weather-forecast/291658'

wget -q -O- "$URL" | awk -F\' '/acm_RecentLocationsCarousel\.push/{print $12 }' | head -1

In response, it receives the temperature value (subsequently displaying it on the screen)
The problem is that bash in / dev / ttyATH0 is not executed.
The port is configured. stty -F /dev/ ttyATH0
cs8 57600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts
-hupcl /dev/ttyATH0 arduin receives data.
And when, instead of an arduino, I hook up a computer and putty connects at a speed of 115200, bash is executed.
I tried setting stty -F /dev/ttyATH0 to 115200 , then the entire openwrt router boot log will appear on the display, and I get something like /bin/ash not found on commands .
Uncommenting and commenting out the line #ttyATH0::askfirst:/bin/ash --login in /etc/inittab did not give a clear result, it only worsened ...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question