Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

How to for Arduino

marcinma edited this page Nov 17, 2014 · 14 revisions

Configuration Steps

  1. Ensure you have the latest version of the iotkit-agent installed on your board.
  2. Ensure you have the Arduino IDE (for Galileo) installed, the correct Serial/USB driver and the correct COM port set. You should be able to download a simple sketch such as the "Blink" example and see the LED blink.
  3. Ensure the board is set to the current UTC date/time. You can do this by SSH-ing into the board and running the 'date' command, or run the following Arduino script:
void setup() {
    system (“date > /dev/ttyGS0″);
}

void loop() {
}

If you still have date issue check if you can connect to time servers described in /etc/systemd/timesyncd.conf . If you are behind proxy check your NTP configuration How to check.

  1. Import the IoTkit Arduino library as follows:

    1. Download the IoTkit.zip file from the iotkit-samples/arduino directory to your computer
    2. From the Arduino IDE, select Sketch -> Import Library -> Add Library
    3. Select the zip file you downloaded in step i, click "open"
    4. You should see a message like: Library added to your libraries. Check "Import Library" menu.
  2. Create an account on enableiot.com and register your device.

  3. Open the IoTkitSimpleExample (File -> Examples -> IoTkit), compile and download it to the board.

  4. Confirm data is being sent to the broker. You can do this by going to your account at enableiot.com and selecting the "Charts" tab. In the tree, find your board and click on the metric name below it ("temp"). In the pull-down toward the top right, select "Last 15 minutes". You should see some data in the graph.

  5. Make WiFi start after device reboot:

    1. configure wifi:
    > cofigure_edison -w
    1. Enable wpa_supplicant:
    > systemctl enable wpa_supplicant 
    > reboot

    check if Wifi is working after reboot if not then do following:

    1. your wlan0 is defined in:
    > vi /etc/wpa_supplicant/wpa_supplicant.conf
    1. remember order for your wlan or run:
    > wpa_cli list_networks
    1. check wpa_supplicant.service:
    > systemctl status wpa_supplicant
    1. if not running:
    > systemctl start wpa_supplicant
    1. enable your wpa_supplicant for your wlan:
    > systemctl enable wpa_supplicant   
    > vi /lib/systemd/system/wpa_supplicant.service
    1. check if your exec uses proper config: ExecStart=/usr/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf
    2. enable your wlan: ExecStartPost=wpa_cli enable [number form list_networks]
Clone this wiki locally