Skip to content

Setting up an Intel Edison Server

Ka-Ping Yee edited this page Jun 21, 2019 · 2 revisions
2019 status: Obsolete

First prepare a flash station.

Note: if the build server is down or you don't have an internet connection, you can set up a local package server using the instructions here.

Flash the Edison

  1. Prepare two micro-USB cables (make sure they are data cables, not just charging cables). Plug them into the Edison, but not into your flash station yet (you will plug it into the computer after the flash script starts running). If you have a battery on the Edison, turn it off; you don't want the Edison running as you plug it in to flash it.

  2. Open a terminal window and cd into your buendia repository. If you don't have the buendia repo locally, clone it:

    git clone http://github.com/projectbuendia/buendia
    cd buendia
    
  3. If you are trying to build a server from a release, you need to use the latest successful build on the Jenkins server. So instead of git checkout master, you will use git checkout vN.N.N (where N.N.N is the relevant version number). Do a fetch and check out the latest release tag:

    git fetch
    git checkout vN.N.N
    
  4. Start the flash script by typing:

    devices/server/setup {root_password} {wifi_network_name:wifi_password} {site_id}
    

    For example:

    devices/server/setup password GoogleGuest:googlepassword msf-mg
    

    Note: {root_password} refers to the root password you wish to set for the server, not the password on the machine you are using to flash. The {wifi_network_name} should be the name of a currently available wifi network with Internet access. If the local wifi network has no password, just give the network name; if it has a password, give the network name followed by a colon and then the password. The {site_id} refers to the name of the facility where the server is expected to be deployed; in the example above it refers to a Médecins Sans Frontières facility in Magburaka (msf-mg). The {site_id} must correspond to a buendia-site-{site_id} package that has been included in a release and successfully built by the Jenkins server (see the Server Release Procedure page for more details).

  5. Follow the instructions in your terminal. First it will ask you to plug in the Edison; at this point plug the two USB cables attached to the Edison into your computer. Flashing should be done after about 45 minutes. During this time, look at step 6 where you will see how to follow the progress of the flashing.

  6. In a new terminal window on your flash station, connect to the console so you can see what is going on:

screen /dev/tty.usbserial* 115200   # on Mac, or
screen /dev/ttyUSB* 115200          # on Linux

Note: if you want to read the install logs later to check for bugs, use the -L option in screen as below:

screen -L /dev/tty.usbserial* 115200   # on Mac, or
screen -L /dev/ttyUSB* 115200          # on Linux

If using a Mac, you may have problems with using screen to access the Edison. The drivers here may be of use. More context on this problem here.

  1. If using a Mac as a flash station, the process may get stuck at the first power on as the newly flashed Edison is no longer seen as the same device by the Network Preferences (see the Preparing a flash station page. You may need to set it to have IP address 192.168.2.1 which is what the script expects. If this happens, go to Network Preferences and you will see a device called "Edison". For "Configure IPv4" select "Manually" and enter 192.168.2.1 as the IP address.

Do a few final configuration steps

  1. First check that you can ping the Edison: ping 192.168.2.15

  2. In a web browser on your computer, go to http://server/. You should see a dashboard page. Under System Maintenance, click "Server clock" and then "Set the server clock".

  3. See if you can ssh to your Edison, using the root password you entered: ssh -p 9022 [email protected]

  4. If you need to set the wifi SSID or password (for wifi at the deployment site) or the OpenMRS password, do this now by adding a text file in /usr/share/buendia/site with a higher number than any of the existing files (e.g. 60-passwords) and put any or all of these lines in the file, filling in your desired values: NETWORKING_SSID=wifissidgoeshere NETWORKING_PASSWORD=wifipasswordgoeshere SERVER_OPENMRS_PASSWORD=openmrspasswordgoeshere

  5. Get the latest "client master" .apk file and copy it to the Edison so that it's available for easy installation on tablets:

```
chmod 644 buendia-client-master-0.4.apk
scp -p -P 9022 buendia-client-master-0.4.apk [email protected]:/usr/share/buendia/packages/buendia-client-0.4.apk
```
Note it is important that the file have a name in the form `buendia-client-x.y.z.apk` where `x.y.z` is a version number.
  1. Reboot the Edison: ssh -p 9022 [email protected] reboot

Test the installation

  1. The Edison should now be serving using the wifi network and password you configured. Connect to the same wifi network with your computer.

  2. In a web browser on your computer, go to http://server/. You should see a dashboard page.

  3. The heading at the bottom of the dashboard page will initially say "CURRENTLY DOWN" when the server boots up. About 5 minutes after booting, that should change to say "CURRENTLY SERVING".

  4. If you click "Download client app" you should get to a page offering the .apk file for download.

  5. In a web browser on your computer go to http://server:9000/openmrs. You should see the OpenMRS login page.

SSH access

If you need to ssh into the working Edison server:

ssh -p 9022 root@server

If you get a security/permissions error, adding the argument -o HostKeyAlias=openmrs may resolve it.

Backing-up and restoring Edison images

This is still work in progress, so the code here isn't tested. Source: https://communities.intel.com/thread/55807

Back up Edinson image to *.img on a micro SD card that is mounted at /home/edison/sd

dd if=/dev/mmcblk0 of=/home/edison/sd/edison_backup.img bs=1M

Flash image to Edison

dd if=/home/edison/sd/edison_backup.img of=/dev/mmcblk0

The back-up line has been tested and appears to work. The re-flash line hasn't been tested, but apparently has worked for someone when the line was called from command line of an already working Edison system. Hence this isn't a comprehensive flash method.

Clone this wiki locally