loading linux kernels, installing application software and uploading arduino firmware on a v2
Chances are we already did this for you, unless you are really lucky (first generation boards). Then again, should you choose to rebuild everything to it’s defaults oem stage, this is the same procedure. This is what you would do after debricking your board as well (after a few other steps).
- From a separate window or tab on your terminal, download and copy the kernel file to the controller using the following syntax
- This should download a the kernel file called v2kernel.tgz
- Remember the location of the download
- Power your v2 board using the 9-48vdc supply on the dc socket and depress the power switch
- On your computer, scan for WIFI networks and look for an Openwrt_XXXXXX access point
- Connect to this ( in my case this time it is Openwrt_FFFFFF)
- DHCP should assisgn you an ipaddress in the 192.168.1.x network
- run the following command from
- use the following command to change the root passwd
- In a separate terminal window access the folder where you downloaded the kernel
- from the download folder copy the file to the client using the flowing syntax
scp v2kernel.tgz email@example.com:/tmp
- from the telnet window connected to the client, change directory to /tmp using the following syntax
- extract and install the kernel using the following syntax:
tar -xzvf v2kernel.tgz
sysupgrade -v -n openwrt-ar71xx-generic-oolite-squashfs-sysupgrade.bin
- The controller will reboot after the kernel upgrade – do not touch your controller until it reboots to avoid bricking it. Look at the system LEDs they should flash as the system boots.
- because we just did a system factory flash, we have to reset our password again, but this time we have to use the ethernet cable
- connect your ethernet cable from your computer to the controller as shown above
- the controller should assign you an ip address in the 192.168.1.1 network (this can get confusing if your wifi access point is already configured on the 192.168.1.x network). for now, in this case, disable you computer wifi as you following these instructions to avoid ip address conflicts between the controller and your computer.
- telnet to over ethernet to change the passwd, as previous shown before
- change passwd as befefore, using:
- exit out of telnet by typing ‘exit’ and ssh to the controller using
- because of the earlier scp session, linux may give ssh errors thinking it is man-in-the-middle attack. fix it using the instructions it presents to you as shown below, the ssh in again using the default password ‘tempV2pwd’ set above (use whatever password you set)
- in ubuntu, fix by copying and pasting the command on your terminal suggested as shown in the diagram above:
ssh-keygen -f "/home/emaundu/.ssh/known_hosts" -R 192.168.1.1
- then connect again using ssh as shown below:
- the reason for this dance is because by default no password is set for root, and ssh/scp will not work without a password. so we have to connect with telnet first to create a root password, then we can use the more secure ssh tools. our computer things we are being hacked as we are connecting to two machines(old and new) that are the same machine!
- extract the application package:
tar -xzvf kijanigrowsV2install.tgz
- this should reboot the controller at the end of it’s execution to finish it’s configuration
- if all goes well, the controller should boot and it’s onboard 8 gpio LEDs should be flashing at a one second interval after it resumes.
- we are now ready for the 2560 arduino sketch
Openwrt is fun as it also include LuCi – a web user interface for embedded devices. So system configuration is easy and does not involve command line processes.
Configuring Host names and Time-zone
With the ethernet cable still connected open up a browser and point the url to
- Log in using your custom password you created in the previous steps or use the default password ‘tempV2pwd’ in the following screen
- Click on the System drop down menu then Select System from the options as shown below:
- Change the Hostname and Time on the system presented as shown below:
- Click on Network then WIFI
- The WIFI screen shown below should open.
- Click on the ‘scan’ button to begin looking for WIFI access points
- Look for your WIFI network on the list and clink on the ‘jon network’ button the far right side on the line with your WIFI access point
- Enter the WIFIs password and submit, then save and confirm
After your client connects to WIFI, see it’s new WIFI address from the status screen as shown below:
Installing arduino firmware
Normally, the arduino and linux communicate through the serial line UART0 with the programming switch on the 9331 side. UART0 is also used to program the atmega 2560 but in this case with the switched flicked onto the 2560 as shown below.
Restart your smart controller by pushing the power botton ( will have a script for doing this more elegantly shortly)
If all goes well, your controller should started up with Leds flashing and scrolling. This time your data should be going to the remote server.
Website url for testing your build will come here shortly. currently using grafana at http://api.kijanigrows.com:8080/grafana