Difference between revisions of "Wio Devices"

From AMTech WikiDocs
Jump to: navigation, search
(How to configure and flash a Wio Link)
(Using these instructions from a M2MBridge device)
Line 54: Line 54:
 
  source py2/bin/activate
 
  source py2/bin/activate
 
  cd wio
 
  cd wio
And then proceed to the connection of the wio device to the Raspberry PI, identify the USB device in the system and now you get all set to execute any of the two procedures
+
And then proceed to the connection of the wio device to the Raspberry PI, identify the USB device in the system and now you get all set to execute any of the two procedures.
You can skip steps 1-8 of procedure to Flash a Wio device or steps 1-4 of procedure to configure a Wio device
+
You can skip steps 1 to 8 of procedure to Flash a Wio device or steps 1 to 4 of procedure to configure a Wio device
  
 
== References ==
 
== References ==
 
See [https://github.com/Seeed-Studio/wio-cli] for more information about the wio-cli interface.
 
See [https://github.com/Seeed-Studio/wio-cli] for more information about the wio-cli interface.

Revision as of 17:06, 11 January 2019

Wio* devices is a class of devices that allows the integration in the AMTech Platform of hundreds of sensors, actuators, etc. The hardware is mostly developed by Seeed Technology Co.,Ltd. but they allow the development of drivers to integrate new devices as well. Each device expose between 2 and 6 ports where you can connect analog, digital, I2C or UART devices. They all use grove connectors which are developed by the same company. We currently support the integration with Wio Link and Wio Node devices.

Configuration procedures and troubleshooting

How to configure and flash a Wio Link

Procedure to flash a Wio Link after something goes wrong or the device is bricked:

  1. A python module is required. Consequently we start by installing virtualenv
    pip install virtualenv
  2. Create a new virtualenv environment for python 2
    virtualenv -p python2 py2
  3. Load environment
    source py2/bin/activate
  4. Install esptool requirement
    pip install esptool
  5. Create directories for required wio files. For instance: wio
    mkdir wio
  6. Change directory to wio
    cd wio
  7. Download firmware files user1.bin and user2.bin into this directory
  8. Download esp8266sdk1.4.1.zip and unzip it into wio directory
  9. Connect the wio device through USB and identify the device in your system. By running dmesh you can try to find a line like:
    usb 1-1.3: cp210x converter now attached to ttyUSB0
    Meaning that the device was recognized and is attached to /dev/ttyUSB0
  10. Execute the following line (correcting references if needed):
  11. esptool.py -p /dev/ttyUSB0 -b 230400 write_flash --flash_size 32m-c1 0x0000 boot_v1.4\(b1\).bin 0x1000 user1.bin 0x101000 user2.bin 0x3fc000 esp_init_data_default.bin 0x3fe000 blank.bin

Configure a Wio device using the command line interface tool wio-cli

  1. A python module is required. Consequently we start by installing virtualenv
    pip install virtualenv
  2. Create a python2 environment:
    virtualenv -p python2 py2
  3. Load the environment:
    source py2/bin/activate
  4. Install requirements
    pip install wio-cli
  5. Login with wio login. If first time:
    • Select customize server
    • Select raspberry pi address like http://<external address>:8080 even if running locally
    • Type email address: amtech@amtech.mx
    • Type password: 4mt3ch.
  6. Setup a new device with wio setup
    Read on-screen instructions: make sure that the wio is in setup mode and that you are connected to the server
    • Select wio link or node depending on the device you are configuring
    • Choose to enter wifi configuration manually
      SSID: amtech-pi
      WIFI password: freepass
    • Type a device name
    • Accept information and wait for the setup to finish. You should see a success message and a "Configuration complete!" message at the end.
  7. At this point you are ready to continue the configuration of the Wio device through the Wio App as explained in the Wio Link wiki

Using these instructions from a M2MBridge device

The image provided by AMTech for their M2MBridges already contains a configured environment for the execution of the two procedures previously detailed. If you login as amtech in the M2MBridge there are two folders py2 (with a python 2 virtual environment) and wio that you may use. Execute the following instructions to load the python environment:

source py2/bin/activate
cd wio

And then proceed to the connection of the wio device to the Raspberry PI, identify the USB device in the system and now you get all set to execute any of the two procedures. You can skip steps 1 to 8 of procedure to Flash a Wio device or steps 1 to 4 of procedure to configure a Wio device

References

See [1] for more information about the wio-cli interface.