Giant Board is a single-board computer based on Arm Cortex-A5 SAMA5D27 microprocessor that runs at 500 MHz. It consumes about 140 mAh current when powered from a 3.7 V Lipo battery.
Goal of this project :
- Prepare hardware for the project before working with software
- Setup micro SD card with Debian Linux image using Balena Etcher program
- Login into Giant Board with Putty Terminal over USB-Serial
- Enable overlay for ADC and WiFi support
- Setup WiFi FeatherWing for Giant Board
- Install SSH on Giant Board
- Connect and login to Giant Board wirelessly over Wifi-SSH
- Read ADC wirelessly
- Logging data on a text file with timestamp
Here are the hardware needed for the project - Giant Board, WiFi FeatherWing board, card reader and micro SD card, FeatherWing Tripler, LiPo battery.
I salvaged the LiPo from an old laptop, it has 4000 mAh capacity. The FeatherWing Tripler will connect the battery to the Giant Board and WiFi FeatherWing board through Vbat and Gnd pins.
I have soldered 0 ohms link to connect positive terminal of the battery to Vbat of Giant Board and negative terminal of the battery to Gnd.
FeatherWing Tripler interconnects all the power and signal traces between Giant Board and WiFi FeatherWing. Putting all the pieces together, I end up with assembled hardware like this :-
For this step I first downloaded the Balena Etcher program from here https://www.balena.io/etcher/ and installed it on a windows machine.
This program can flash any linux image into a micro SD card. As for the Debina Linux image for Giant Board, I downloaded the latest image from here ftp://downloads.groboards.com/giantboard-debian-9.12-1GB-6-9-2020.zip
Next, I inserted the 32 GB microSD card on a card reader and connected it to an USB port on my windows machine. Then, I run the balena Etcher program, selected the downloaded image, selected the micro SD and hit Flash.
After few minutes the linux image is successfully loaded on the micro SD card. Finally, I took the micro SD card from the card reader and insert it on the micro SD card slot on Giant Board.Step 3: Login into Debian Linux on Giant Board
Giant Board has some power supply issues (keeps restarting) while powering only with USB cable. This issue can be resolved by powering the board from a LiPo battery while using USB cable for communication. There is a Green power LED and Orange data LED on Giant Board. A successful boot up will cause the Orange LED to rapidly flash for the first few seconds after power up as shown in the following video :-
If the Orange LED does not blink for some reason during boot, here are few things to try :
- Disconnect both LiPo battery and USB, then power the board again
- Take out the micro SD card and insert it back again
- Try a new micro SD with a fresh image (step 2)
Next you would want to download putty terminal program, install and run the program. Connect the Giant Board to computer with a USB-micro data cable. Find the Serial COM port from device manager, type in the COM Port number (COM12 in my case) and baud rate 115200 on Pytty, then click Open.
A window like following should appear if everything went well. This is the CLI interface for Debian Linux running on Giant Board. You type here commands to get things done !
If you don't see anything, press enter. If that does not solve, disconnect power from Giant Board (both battery and USB) and try again.
- username name is debian
- default password is temppwd
- default root password is root
- root user privilege command is su root
(press enter after typing each command to execute)
After successful login you may change the password. But you must expand the file system with following command : sudo /usr/bin/grow_sd.sh
Giant Board will reboot after this task is completed.
Once this step is done, Linux goodies (applications) can be installed on the device.
Here are the official documentations for login and file system expansion :-
This board runs with only 128 MB DDR2 RAM. Something that you are not going to use should be kept disable for smoother operation. To use ADC and WiFi from next boot, these must be enabled. This is done by editing the uEnv.txt file resides inside the BOOT directory. BOOT directory shows up on your PC as a removable drive when the Giant Board is connected through a USB cable.
Following modifications will enable ADC and WiFI :
Remove the # to un-comment and enable overlays
Add following 2 lines after that and save the file, then restart the Giant Board !
dtboverlay1=/overlays/GB-ADC.dtboStep 5: Setup WiFi featherWing for connectivity
Giant Board connects to WiFi FeatherWing board through FeatherWing Tripler. Wifi FeatherWing is ATWINC1500 Wifi module based board.
When the board reboots after the overlay step, login to Debian. Then type following commands one by one on Giant Board CLI terminal, (press enter after typing each command to execute) :-
Start the network manager with command
Once connmanctl is running following commands will work.
Now enable Wifi hardware with command
Scan for SSID with command
Then list all available SSID in the vicinity with command
Enable connection agent with command
Connect to your Wifi network with command
Where wifi_*_managed_psk is the number next to your Wifi networks name (see image below)
When prompted for password for WiFi with passphrase ? , Type the password on CLI terminal and hit enter (in my example WiFi password is Hydrogen, you have to type your WiFi password !)
Once the connection is completed Exit connmanctl utility command
Now check internet connection with command
If everything went all right you should see ttl messages with ping delay !Step 6: Install SSH on Giant Board
If everything went well, Giant Board should be connected to the internet by now. Now you can install almost any Debian package on the device !
Before installing the SSH update the apt package repository cache with following command:
sudo apt-get update
It will take few seconds to to update the cache. Once that is done, type following command and hit enter:
sudo apt-get install openssh-server
When prompted with message "Do you want to continuse ?", Type "Y" and press enter to download and install the package. Wait until the installation is completed.
Now, make sure that the SSH server is running with following command :
sudo systemctl status ssh
By default, it will automatically run after boot unless you disable it. It will listen on port 22
Now type following commands to restart the board:
Step 7: Wirelessly login on Giant Board over WiFi SSH
su root<provide root access password when asked>reboot
Now, you can access your Giant Board without any USB connection. Disconnect the USB data cable and power the board only with LiPo battery.
To login on your Giand board, you need to figure out it's local IP address from your WiFi router's user interface/configuration page like this. This step is slightly different for different brand's routers.
(You can find your router's default IP and password on a sticker attached on the bottom ofyour router )
Login into your WiFI router's UI page with IP 192.168.0.1 from a web browser, find the Wireless Client list, locate the client name giantboard and note the IP address next to it.
In my case, the IP address is 192.168.0.100 (see image below)
Now, run Putty terminal application on your PC, select SSH, type the giantboard's IP address, 22 as SSH port, then click Open.
Type debian after login as: and hit enter. Provide the password (temppwd or whatever you have changed).
You will see the welcome screen of Giand Board. Now you can run the Giant Board untethered !
If you want to access your Giant Board from Android phone, this app works :Step 8: Read ADC wirelessly
On this step I want to poll ADC channel 4 data every second with a bash while loop. This while loop will execute following commands:
(type one line at a time on Giant Board CLI terminal and hit enter)
while :doecho "ADC raw value $x"x=$(cat /sys/bus/iio/devices/iio:device0/in_voltage4_raw)sleep 1done
This will pring ADC data every second on the terminal. Use keyboard keys Ctrl+Z to stop.
Alternatively you can make a script with these commands, save it on the sd card and run whenever is needed.
Finally, I am going to show you how to log these ADC reading on a text file. For this step you need root access with following command :
Provide the password root (or whatever if you have changed it before)
Now create a text file named ADC_log.txt with touch command
If you don't have root access, this touchy step will be denied. Make sure your text file is in the root directory with following command
You should see ADC_log.txt and bin in the root directory
Now write a bash while loop to read ADC data with timestamp and put it on the ADC_log.txt
(type one line at a time on Giant Board CLI terminal and hit enter)
while :dox=$(cat /sys/bus/iio/devices/iio:device0/in_voltage4_raw)y=$(date)echo "On $y , ADC data is $x" >> ADC_log.txtsleep 2done
Once you hit enter, nothing will happen ! Because, it's running in the background. Wait about 10 seconds, so at least 4-5 reading are saved. Press Ctrl + z with your keyboard to stop the job (process).
Now you want to check if you were able to log some ADC reading over last few seconds. Issue following command to open the ADC_log.txt file with nano utility
Type "Y" and hit enter to continue.
You should see the logged info like this :-
There you have it, a basic sensor data logger with Giant Board on Linux. You may want to write a script for the while loop block, so you can reuse it again without rewriting the commands.
Add your voltage dividers on ADC pins, scale down voltages according to your need. Using similar technique you can save data from I2C or SPI sensors too.
For details about ADC on Giant Board, check this link:Conclusion
Here are some excellent resources that can help you explore Linux and Python on Giant Board:-
I played with some commands, most of them worked (curl didn't for example). I ran some math series (fibonacci) on python 3 to heat up the 500 MHz MPU. Also, installed some packages like Samba Server, LXDE gui on Giant Board and experienced sluggishness.
Heck, I even installed and played Pac-Man on Giant Board CLI terminal. My linux knowledge is pretty basic but it was fun playing with Giant Board, lots of things to explore and learn.