This tutorial takes you step-by-step on how to use the WisCAM Linux based IP camera from RAK Wireless and to get the rtsp stream functioning. We will also delve deeper into the linux side of the board and see how to access the serial port for debugging, some of the networking essentials. Finally we will see how to user the inbuilt ser2net feature to access some of the settings of the board via HTTP requests.
The Board.The wiscam is a awesome little Linux based IP camera that stream video via rtsp. The board runs on a Nuvoton N32905R3DN processor which is built on the ARM926EJ-32-bit RISC CPU core. The frequency can be upto 200MHz@1.8V. Its fascinating how linux is so versatile to run on such a resource constrained appliance.
Some of the other features are:
- Wifi: Networking on the board is taken care by the RTL8189FTV Wi-Fi chipset and it supports IEEE 802.11 b/g/n protocol. The radio has a 1t1r antennae and SDIo interface.
- SDCard interface and attachment board. The board comes with a daughter board which as a UDB host and a sdcard attachment.
- Camera: The camera module boasts an decent speced camera module which can also send across RAW data for further processing.
- Support for Nabto P2P cloud service inbuilt. The Nabto P2P service is in built and we will cover how you can use the service for transmitting your video feed over cloud in another tutorial.
So this opens up a lot of cool features for the board and in essence is a real MAKER board with lots of GPIOs, peripheral interfaces and a video stream feature.
For a visualization, here is how the camera module interacts with the wifi for streaming data:
The board opens up a lot of its GPIO via the arduino compatible headers: Here is a diagram of the WisCAM pinout: WisCam provides a 10-bit ADC, a MIC-phone, a UART, a speaker and a dozen of GPIOs(the number will change with different Sub-Board).<dig>
Some of the important pin mapping are denoted below:
PIN Default Config
- HUR_TXD/PWM1/GPD[1] UART TransparentTXD with 3.3V level
- HUR_RXD/PWM2/GPD[2] UART TransparentRXD with 3.3V level
- IOH1 Speaker Enable PIN High_Level : Disable(Default)
- BOOT/GPA7 Run into Recovery Mode or Normal Mode Normal Mode : Set High_Level(Default) when power on Recovery Mode :Set Low_Level when power on,burn firmware.
- URTXD/ GPA10 Debug UART TXD with 3.3V level
- URRXD/ GPA11 Debug UART RXD with 3.3V level
- 5V Power Supply input,DC5V. And another 5V PIN can output 5V Power at the same time . If use micro-USB as power source ,the two 5V PIN are work as outputing power source .
Before you move on make sure you have the RAKVideo app installed on either a android or a iOS device. Also make sure you have VLC on your windows or linux machine just in case if you want to view the stream on your desktop.
- Android: https://www.pgyer.com/wiscam
USB Modes: POWER and UVC mode
The board connects differently when connected a power socket or to a active windows machine when connected via a micro USB cable.
UVC Mode:
In UVC mode the camera acts like a USB camera. Use a software like AMCap or the Nuwicam UVC utility to view the feed from the UVC mode.
- GTK+ UVC Viewer: http://guvcview.sourceforge.net/
Working with UVC:
The UVC standard was common practice amongs IP Cameras and a good library is available to work with the UVC standard. LibUVC is available @ https://github.com/ktossell/libuvc and the docuentation on how to use the library is available at: https://int80k.com/libuvc/doc/
POWER Mode:
When connecting the board via micro USB cable only to power, the board will enter the Power mode. Here the wifi wlan0 abd wlan1 and will be active and wlan1 will strat transmitting itself as a SOFTAP. The Board will then start broadcasting its SSISD as WisEye-xx-xx-x-xx-x. The default encryption is WPA2PSK and the password is 12345678.
Setting up a local stream server.It is possible to use the board standalone and broadcast te rtsp video stream locally to connected devices. The boards wlan1 accepts in coming STA device requests and allow to connect the Wiseye AP. Once connected the board gets the IP of 192.168.100.1 and all other devices connected to the board can stream using this IP.
The camera rtsp url is: rtsp://192.168.100.1:554/cam1/mpeg4
Now proceed to installing the Wiscam app on Android (or iOS) if you haven’t done yet and in the splash page click on the pencil icon on the top right. It would show a popup asking for the rtsp stream URL provide the URL as above and click ok. If the camera is connected to power and the phone is connected the Boards wifi Soft AP, then you should see the board in action and streaming vi0deo to the Android/iOS device.
Integration with Windows:
Windows boxes can also try to read the stream locally if they are connected to the wisap softap SSID. For this, you need VLC which can handle rtsp stream.
Click on open network stream: The following box will open:
Enter you rtsp URl is the box provided and click play. You Wiscam should start sending in the feed:
Notes: If feed is not coming up
- Make sure the board is powered on and the blue light is blinking to show the transit of data, use a 5v 2a wall wart to power the board in POWER mode.
- Make sure that the Camera board and the devices from which you are trying to read the stream are connected the the AP of the wiseye board.
As this is a linux board with some wireless networking, it is possible that the end user may want to connect this camera to another AP rather than acting like an AP. The board provides two mechanism to connect to the board and set the DHCP based STA connection mode for this board.
HTTP way:
The board provides a HTTP interface via the ser2net program and exposes some of the networking utils to the browser. The board supports either running as an AP or as a Wifi Station and connect to your router.
The generic way of listing the attributes various service running on the board is by the HTTP GET command:
(http://192.168.100.1/cgi-bin/param.cgi?action=list&group=xxxx
Where xxxx have various option: wifi, stream, nabto
For wifi refer to the tables below
So to change the wifi SSID and password of the STA mode follow these two urls with the relevant section in {} edited to suit your setup:
http://{IP-Address of camera}/cgi-bin/param.cgi?action=update&group=wifi&SSID={wifi name}
http://{IP-Address of camera}/cgi-bin/param.cgi?action=update&group=wifi&AUTH_KEY={wifi
password}
Accessing other important confgurations:As discussed in the previous section, the board provides the stream, nabto and restart.cgi scripts to alter the properties of the camera and the Nabto in built service. We will handle connecting the camera to Nabto P2P services in another tutorial.
The Linux side of the board.
This is where it gets interesting. The board is basically running Linux with kernel version 2.6. It’s a completely stripped down version of linux running on the bare minimum needed services and apps. Don’t expect fancy stuff like package managers, GUI ect J
However, this adds a whole lot of configuration and processing power behind a simple camera board. The linux side is fairly similar to a common-place embedded linux design and has a set of important services running
- busybox.1.15.2 Linux shell http://www.busybox.net/about.html
- dnsmasq-2.60 DHCP server http://www.thekelleys.org.uk/dnsmasq/doc.html
- Hostapd Wi-Fi access point and authentication server http://hostap.epitest.fi/wpa_supplicant/
- spook-20050207 RTSP server http://www.litech.org/spook/
- wireless-tool.29 Network configuration utilities http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html
- wpa_supplicant IEEE 802.11i supplicant http://hostap.epitest.fi/wpa_supplicant/
- ser2net-2.10.0 Serial to Network Proxy http://ser2net.sourceforge.net/
- boa-0.94.13 Light-weight Webserver http://www.boa.org/
Adding the URL here if you want to refer to their surce code and edit some programs for your projects.
Escaping from the STA mode !!!
It may so happen that the STA configuration we pushed through HTTP ser2net appliance failed and we would want to revert to the factory AP mode.
For this purpose the GPIO A5 has been provided. Pull down the GPIOA5 marked as GPA5 in the pin diagram in the beginning of this tutorial like so:
Keep the GPA5 connected in this configuration for 5 seconds and then restart the board.
Connecting with serial to usb device:For debugging purposes it may be necessary to conect the boards serial port to a windows or linux PC for seeing system messages. For this purpose we chose a FTDI cable like the Sparkfun little FTDI basic cable and connect like so:
- GND to GND pin on Wiscam
- RX to TXD pin on Wiscam
- TX to RXD Pin on Wiscam
Now Open up you favourite serial client like putty and open up the concerned PORT at 8N1 setting at 115200 baud rate
You will get access to the linux console and can try and access some basic commands to get hold of the terminal.
Some Interesting integration:Camera board open up a wide possibility with image/object recognition, visual programming and so on. Some of the coolest platforms for this are:
Processing: Processing is a java based creative programming language that helps programmers draw on a canvas using creative coding. The platform has come a long way and is now very very mature for video application projects:
Resources:
Procesing + OpenCV library: https://github.com/atduskgreg/opencv-processing
Processing + gstreamer implementation for video processing: https://github.com/processing/processing-video/wiki
OpenFrameworks: openFrameworks is an open source C++ toolkit designed to assist the creative process by providing a simple and intuitive framework for experimentation.
Openframeworks and Gstreamer: https://github.com/arturoc/ofxGStreamer
Openframworks rtsp stream handling (MacOS example): http://blog.geoffdonaldson.com/2013/02/14/using-the-gstreamer-sdk-in-openframeworks-under-osx-10-8-mountain-lion/
Comments