Tag Archives: A13

A13-OLinuXino Bare Metal Programming without Linux and Android

Image

 

https://www.olimex.com/wiki/Bare_Metal_programming_A13

Sometimes it’s not necessary to have OS for your application and in this case all processor resources are at your disposal, Scott (aka forum member saand) started thread at our forum about this https://www.olimex.com/forum/index.php?topic=1208.0 and after a while he succeeded to run his “hello world” code right from uboot before starting Linux or Android, the benefit, instant code run without waiting seconds for OS to boot.

 

Tagged , , ,

A13-OLinuXino-WIFI and OpenCV Face detection project

Image

 

We continue the experiments with OpenCV, this new project detect human face, mouth, eyes and upper head position.

When human Face is captured by the camera it’s coordinates are detected then with push button switch you can attach Mustache, Glasses or Horns on the detected Face.

The project sources are on GitHub: https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/A13-OLinuXino%2BOpenCV-Face

Here is video : http://www.youtube.com/watch?v=pLHQZte-FuY

Tagged , , , , ,

Where do you use your OLinuXino?

Image

What you see on the picture is payment terminal made with A13-OLinuXino and some UEXT modules, this picture was sent to me by Skaag from #olimex irc channel at freenode.

Matthias (aka Madze on #olimex channel) also send some preliminary pictures of his work on the lawn mower with A13-OLinuxino as you can see on the pictures serious engineering work is done and soon OLinuXino will log the lawn mower activities:

Image

Image

ImageImage

 

wheel_sensor_2

So tell us what project you did with your OLinuXino?

Send us pictures at info at olimex dot com.

Tagged , ,

Add Bluetooth to A13-OLinuXino-WIFI with MOD-BT

Image

 

To add Bluetooth connectivity to A13-OLinuXino is very easy with MOD-BT as both have UEXT connector.

To tune MOD-BT is a bit tricky though as by default on UEXT UART is conected the console so all console messages will go through MOD-BT and vice versa all messages from MOD-BT will go as commands to the console.

Here is the correct sequence to enable Bluetooth on A13-OLinuXino with MOD-BT:

1. Make sure you have ssh enabled

# /etc/init.d./ssh start

2. Reboot A13 WITHOUT MOD-BT

 

3. Connect via ssh

#ssh root@192.168.0.xxx

 

4. Disable the console to UEXT UART

#nano /etc/inittab
and comment "T0:23:respawn:/sbin/getty -L -a root ttyS0 115200 vt102"
then restart inittab
#init q

5. Connect MOD-BT to UEXT end enter the following commantds:

#echo AT+BTAUT=1,0 > /dev/ttyS0
#echo AT+BTSRV=1 > /dev/ttyS0

these commands initialize MOD-BT to enable Serial UART Bluetooth profile, i.e. from now on all input stream received by MOD-BT will be transmitted to the paired device and all messages received will be sent to the UART

this way you can use remote device to connect to A13-OLinuXino via Bluetooth COM port

 

6. On other PC or PHONE connect to MOD-BT and start virtual COM port

 

7. Enable again the console now which will be seen by the Bluetooth device


#nano /etc/inittab
Uncomment "T0:23:respawn:/sbin/getty -L -a root ttyS0 115200 vt102"
#init q

 that’s it now your console is again enabled but your MOD-BT is configured to send and receive the messages through Bluetooth Serial Port Profile to the paired Bluetooth device

Tagged , , ,

Allwinner’s A10 and A20 are they really pin-to-pin compatible and drop-in replacement

Image

 

 

Allwinner announced A20 processor as drop-in replacement for A10 designs, i.e. you could re-use your A10 board design for the new A20 processors which offer dual core power.

We already blogged that we got preliminary info and schematic to evaluate and last two days our developers were busy to compare the schematic info (as there is no datasheet for A20 yet).

Most of the GPIO ports on A20 match A10 ports, just some ports in A20 now have more functions but keep the old port functionality as well.

Well done Allwinner!

We spot some balls that are with differnt functionality though:

ball.A19   A20.TWI4_CLK   A10.GPS_MAG
ball.A20 A20.TWI3_CLK A10.GPS_CLK
ball.B20 A20.TWI3_SDA A10.GPS_SIGN

these three are minor changes, we do not use GPS signals on board and they go to GPIO connector so no problem

another difference is on these two balls:

ball.R14   A20.NC   A10.VREGIO_HDMI
ball.R16 A20.NC A10.PLLREGIO

these two balls are left not connected on our A10 design too, so no problem

there are some differences in the PIO power supply:

ball.H10   A20 connected to 3V   A10 connected to 3.3V
ball.J10 A20 connected to 3V A10 connected to 3.3V

these two balls are connected to 3V in A20 schematic and to 3.3V to A10 schematic, we have to investigate this further!

the major differences between A10 and A20 are in the DDR3 wiring:

ball.N3   A20.SCKE   A10.SCKE0
ball.J3 A20.SCK1# A10.ODT1
ball.J4 A20.SCK1 A10.SCKE1
ball.AA4 A20.A15 A10.SCS1

A10 have two chip-select one clock and two clock enables (second is not used in our schematic) and addresses up to A14

A20 have one clock enable with two pairs of clocks (one not wired on the A20 reference schematic) and addresses up to A15

so both chips can address up to 2GB RAM but in different way.

We didn’t complete our A10 schematic this info comes right on time, so we can make our schematic compatible with both A10 and A20 and to may support up to 2GB RAM

Conclusion: YES, it’s possible to design board which to may work with both A10 and A20, but not if you have not received the A20 info when you made your A10 board :)  

 

Tagged , ,

A13-OLinuXino-WIFI running SCRATCH + OPEN-CV demonstration

Image

Now when we know how to interface new blocks in Scratch IDE with python and having OpenCV library up and running on OLinuXino it was matter of time to make the new project.

There is already nice project written in Scratch with eyes tracking your mouse pointer: http://scratch.mit.edu/projects/Doody/269924

Also we show you OpenCV object tracking http://www.youtube.com/watch?v=CigGvt3DXIw

Now we decided to combine both in single project:

1. Install scratchpy

# git clone git://github.com/pilliq/scratchpy.git
# cd scratchpy

!!!IMPORTANT: Make sure that you date is set:
# date -s "3 APR 2013"
# python setup.py install

2. Install OpenCV

# apt-get install libopencv-dev python-opencv

3. Install Scratch

# apt-get install scratch

4. Open Scratch and open the demo project Eyes.sb

 

5. A message should appear that remote sensor connection is enabled.

If doesn’t click on “Sensing”, right click on sensor value and click “Enable remote sensor connection”.

6. Open terminal and start the tracking program

# python track.py

7. This will track yellow ball and the eyes will look at this direction

8. If you want to use some other object with different color use config.py.

Start the config:

# python config.py
Move the sliders until only the desired color is white and everything else is black.

Open track.py and edit the following line:
cv.InRangeS(imgHSV,
cv.Scalar(0, 100, 255),
cv.Scalar(40, 255, 256),
imgThreshed)

Write your values, for example:

cv.InRangeS(imgHSV,
cv.Scalar(110, 98, 100),
cv.Scalar(131, 255, 256),
imgThreshed)

Then just start the file:

# python track.py

 

If you wonder what does line 77 k = cv.WaitKey(70) this is delay as OpenCV track the object very fast and send coordinates faster than Scratchpy + Scratch can handle which leads to buffer overflow, with this delay the object tracking is artifically delaed to may Scratch have time to update the animation properly.

Here is video of this project: http://www.youtube.com/watch?v=Pyidx-zOsm4

Note that the camera is put on the top of the monitor and displays mirrored object i.e. when you move the heart right the animation moves the eyes to the right but on the camera you see mirrored image :)

And the GitHub sources are HERE 

Next OpenCV project – Face tracking is in progress, stay tuned :)

 

Tagged , , , , ,

SCRATCH control for MOD-IO

Image

Controlling Relays, Switching ON/OFF of 220V appliances and home automation is possible now with Scratch + MOD-IO.

1. Install python-smbus:

#apt-get install python-smbus
2. Install scratchpy

#git clone https://github.com/pilliq/scratchpy.git
#cd scratchpy
#make install

3. Run SCRATCH and open MOD-IO.sb

4. Go to ‘Sensing’. Right click ‘… sensor value’ hit: ‘Enable
remote sensor connections’ (if it not enabled).

5. Run terminal and start the python script
#python IO.py -a 0x58 -i 2 --host=xxx.xxx.xxx.xxx --port=xxxx --verbose
-i - I2C bus that you're using
-a - Address of MOD-IO (default 0x58)
--host - IP if you're connecting remote computer
--port - Port number
--verbose - Print some debug information.
For example:
#python IO.py -a 0x58 -i 2 --verbose --host=192.168.0.100 --port=40000

You should see message that the program is connected.

6. Run the Scratch block

7. Press ’1′, ’2′, ’3′ or ’4′ to toggle relays

 

the project is uploaded on GitHub: https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/A13%2BSCRATCH%2BMOD-IO

Tagged , , , , ,

Make Door Security Logger with A13-OLinuXino-WIFI + OpenCV

Image

This is cool little project done in minutes with A13-OLinuXino running OpenCV. We were thinking what to make with OpenCV and with the use of GPIOs on A13-OLinuXino and decided to put small switch on our laboratory door connected to A13-OLinuXino GPIO:

Image

then to wire A13-OLinuXino with Web Cam on the old ping-pong table in the front ot the door, so we can sense every time door is opened and closed:

Image

OK, now we are ready and have just to write the python code to log the pictures with the Web-cam every time somebody enters the lab:

from cv2 import *
import sys
import time
import datetime
import A13_GPIO as gpio

def main():
#init gpio module
gpio.init()
gpio.setcfg(gpio.PIN36, gpio.INP)

while True:
#select /dev/video0 as source
cam = VideoCapture(0)
#wait for low level (door open)

while True:
g = gpio.input(gpio.PIN36)
if(gpio == 0):
break
time.sleep(2)

#take 15 pictures, and use only the last one
for i in range(15):
s, img = cam.read()

#get the current system time
now = datetime.datetime.now()
k = str(now)
if s:
imwrite(k + ".jpg", img)
print(k + " -> New image saved...")

#wait for high level (door closed)
while True:
g = gpio.input(gpio.PIN36)
if(gpio == 1):
break

#wait some time (debounce)
time.sleep(1)
if __name__ == '__main__':
main()

You can download the project code and OpenCV installation instructions on GitHub: https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/A13%2BOpenCV%2BDoor-Security

 

 

 

Tagged , , , , ,

Scratch + A13-OLinuXino-WIFI Physical Computing

Image

Scratch is great visual environment very easy to understand by children.

I already blogged that Scratch is running fine on OLinuXino here http://olimex.wordpress.com/2013/03/12/a13-olinuxino-wifi-running-scratch-ide-perfect-platform-for-kids-programming-education/

What bothered us though was that we can’t use all GPIOs and hardware resource which OLinuXino offers and Scratch basic installation can only play music and make cool animations.

So we start searching info how to implement this.

Soon we found SNAP http://snap.berkeley.edu/ which is based BYOB (Build your own Blocks) which is based on Scratch but adds ability to make your own blocks, recursion etc new features.

SNAP is implemented with JavaScript so even better it runs on your Browser without need of installation. Based on SNAP there are few cool projects made by Technoboy10 (https://github.com/Technoboy10) interfacing Wii Nunchuk , Arduino and NXT-Lego robots.

I asked Technoboy10 is there documentation how to connect Hardware to SNAP and soon he published this info in the Wiki: https://github.com/Technoboy10/snap-server/wiki/How-to-create-a-Snap!-Extension which is very detailed.

So How cool is this? Kids are able to program robots with visual IDE!

Looking at Technoboy10 GitHub repository we figured out how to do this, but SNAP basic installation have no such great choice of sprites and animation examples, so I decided for the beginning to try to implement OLinuXino hardware features to SCratch.

So I posted question on Scratch forum and start to wait for reply http://scratch.mit.edu/forums/viewtopic.php?id=115821 . After few days waiting, 30+ views and none reply I did what I had to do at the beginning: searched github for “scratch c” then for “scratch python” and found what we needed:
https://github.com/pilliq/scratchpy.

This is cool python client for Scratch. When you enable remote sensors in Scratch it creates server, then with scratchpy you can pool for given variables and take their values or change them, this way you can connect sensors or actuators.

As opposite to SNAP (where SNAP i client and snap-server is made with pyton, so SNAP connects to the server) here Scratch makes server and the scratchpy client connects to it and interact through variables.

So here is our first “Hello World” blinking LED with Scratch: http://www.youtube.com/watch?v=qbTNWTa5tXQ

Instruction how to install the OLinuXino GPIO interface to Scratch is on GitHub: https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/A13-GPIO%2BSCRATCH

Our second project animate GPIO connector with Scratch based on real buttons inputs and LED outputs:

Image

 

Here is video on the GPIO interaction with SCRATCH http://www.youtube.com/watch?v=DzmvqlQodac

Now when we have this powerful tool: scratchpy to interface Scratch to anything via python, just imagine what would happend if we connect Scratch to … OpenCV :)

From my previous blog I show you some videos which demonstrate the power of OpenCV: face recognition, face expression recognition, color objects tracking.  You can make SCRATCH script for instance which recognize the face of the person in the fron of the web cam and run some animation to welcome it by name.

Or you can program your robot to chase this yellow pong ball which is in the front of it.

Or you can make different animations depend on the face expression of the person in the front of the camera… the applications and the fun will be endless!

 

Tagged , , , , ,

New Debian Images with UVC camera support, Python and OpenCV in Wiki

Image

 

As you maybe noticed we play a lot recently with video processing and OpenCV + Python, so we decided to release new image which includes these packages.

Unfortunately we are on the limit with the current 2GB cards, so we had to release two images:

1. Debian with OpenCV + UVC camera support + Python without XFCE4 which still fits in 2GB cards we ship now.

2. Debian with XFCE4 + OpenCV + UVC + Python on 4GB image. We recommend you to use Class10 card as with Class4 things work many times slower.

We are now working to source new fast 4GB cards which to ship with A13-OLinuXino new image.

You can download the images from our WIKI

Tagged , , , ,
Follow

Get every new post delivered to your Inbox.

Join 234 other followers