The Sonix board dev console can be accessed at 192.168.99.1 and port 2017, with telnet or better yet netcat. (netcat 192.168.99.1 2017). You’ll see a list of available commands there if you type help at the dev> prompt, including the “snapshot” command for taking a snapshot
Here’s one fun hack: automatically take pictures, in this example 100, roughly one per second. Done here as a quick example with tcl/tk expect and a shell script, but lots of ways to do it, with python and pexpect module, programming the web server, etc …
On Linux Ubuntu, install expect if you don’t have it:: > sudo apt- get install expect. This should be possible in windows too as both netcat and expect are available, but I haven’t tried it,
Write the following in, say, snap.exp, replacing the 4th line up to \r with exactly what you seen when you nc into the console. (your compile time and fd will differ).
#!/usr/bin/expect
spawn nc 192.168.99.1 2017
sleep 0.25
expect "Dev console start (compiled Oct 23 2017 17:04:30) fd=12\r
dev> "
sleep 0.25
send "snapshot\r"
sleep 0.5
send "^C"
and the following in, say, snaps,sh:
!/bin/bash
numpics=1
while [ $numpics -le 100 ]
do
echo "Taking picture" $numpics
./snap.exp > /dev/null
((numpics++))
done
Now point your web browser to http://192.168.99.104/filesystem.html, move to the SKYVIPER/Photos directory, execute ./snaps.sh on terminal, and watch that SD card fill up with pictures!
This is of course very rudimentary, but not bad for less than 20 lines of simple code
Note for developers:
-
You can access additional commands with the sys command, including setting debugging options. There are multiple levels and choices once you hit sys with an option, with additional options at each.
-
For the curious, to use the tasks command, you will need to build a kernel (see wiki, building Sonix firmware) with trace enabled. Quick and dirty way. Edit .config in Sonix/buildscript, delete lines containing TRACE and RESCUE, and run make oldconfig. When prompted select yes for TRACE enable, and pass on RESCUE. (firmware doesn’t build otherwise).
-
See also README and devconsole.c