wireless-one-top

Getting Started

Overview I/O Pins

Every header pin can be addressed by the Arduino IDE. For your convenience the description of every pin can be found on the Argolis Wireless One. The pinout layout meets the Arduino footprint standard, including a separate SPI header and additional I2C header.

The description of the header pins below show exactly how to address the pins in the Arduino IDE.

awo-external-connections

3.3V! When you start interfacing the SAML21’s I/O pins with external sensors and other components, keep in mind that each I/O will produce, at most, 3.3V for a high-level output.

When configured as an input, the maximum input voltage for each I/O is 3.6V (VDD+0.3V).

Internal Pin Description

External pin descriptions are a good start to develop basic functionality, but to fully utilize the board, take a look at the internal pin descriptions to use all the built-in functionality.

GPS Switch D18 Output
High: GPS module on
Low: energy saving mode

GPS Timepulse D17 Input
High: every second to synchronise GPS signal
Low: no GPS fix is no timing

User Button D19 Input
High: default
Low: on button push

Power Enable D22 Output
High: to enable power if only a battery is connected

External Switch D23 Input
Connect an external switch and detect a closed switch

RGB LED D14 D15 D16 Output
High: LED is off
Low: LED is on

Power Supply

Power can be supplied to the SAML21 through either USB or by using the power connector. You can connect a single-cell (3.7-4.2V) rechargeable lithium-polymer battery and/or solar panel or an external 5V source. If power is supplied the battery will be recharged automatically. The USB jack is of the micro-B variety. It should work with one of the many USB phone-charging cables. You can plug the other end into a computer USB port, or use a USB wall adapter. The USB supply input includes a resettable fuse – if something on or connected to the breakout fails, it should help protect your supply from damage.

The onboard regulator is low-noise, low-dropout, and can supply up to 600mA, but has a maximum input voltage of 6V. Try not to use any supply larger than 5V.

RGB LED

The status RGB LED can provide andy desired color. With the shield you can show for every status a designated color like debug, power indicator, USB transmit/receive LED indicators, battery charge status indicator and buzzer.The LED indicates activity on the USB serial port while the Arduino is being programmed via bootloader. The “charge” LED is controlled by the board’s integrated battery charger. If a battery is connected and 5V supplied (via USB, solar or the external jack), it will illuminate when a battery is being charged and should turn off once fully-charged.

Battery (Charger)

The standard 2-pin JST connector and a single-cell USB battery charger are integrated into the board. Any single-cell lithium polymer battery can be used to power the board.

To charge the battery, simply connect USB or a 5V supply while the battery is also connected. The “Charge” LED should illuminate while the battery is charging, and it should eventually turn off once fully juiced up.

Cortex SWD Debug Port

With an ARM debugger/programmer like the Atmel JTAG ICE you can interface with the SAML21 Cortex Debug port– a single-wire debug (SWD) interface – to a standardized 10-pin, 0.05″-pitch connector. Any ARM debugger/programmer should work with this port – just make sure the interface cable is pin-compatible.

Hardware Setup

To power the SAML21 board, just plug it into a USB port on your computer. The RGB LED indicator immediately turns on. After plugging the board in, Windows will try to search the Internet for drivers. Mac and Linux users shouldn’t need to download any drivers. The device should show up as a serial port as soon as it’s plugged in to your computer.

The Argolis Wireless One has 3 hardware serials:
SerialUSB – For debugging over the USB Cable.
Serial – Serial attached to pin D12/A12/TX and D13/A12/RX.
Serial1 – Connected to the LoRa Module.

The sketch starts direct after uploading new code or connected to a power source.

With the I2C scanner you can search for all the connected devices to the I2C bus.

Install Arduino SAML Boards

We developed Arduino software for SAML21 support in the Arduino IDE. In a few easy steps you can add ARM Cortex support to your Arduino IDE. This page will guide you te get SAML21 support into your Arduino IDE.

First, you need to install some tools, including low-level ARM Cortex libraries full of generic code, arm-gcc to compile your code, and bossa to upload over the bootloader. These tools come packaged along with Arduino’s SAML board definitions for the Arduino Zero.

To install the Arduino SAMD board definitions, navigate to your board manager (Tools > Board > Boards Manager…), then find an entry for Arduino SAML Boards. Select it, and install the latest version.

Installing the Arduino SAMD boards

Downloading and installing the tools may take a couple minutes – arm-gcc in particular will take the longest, it’s about 250MB unpacked.

Once installed, Arduino-blue “Installed” text should appear next to the SAMD boards list entry.

Now that your ARM tools are installed, add support for the SAM21L boards. First, open your Arduino preferences (File > Preferences). Then find the Additional Board Manager URLs text box, and paste the link from our download url.

Then hit “OK”, and go back to the Board Manager menu. You should (but probably won’t) be able to find a new entry for SAML Boards. If you don’t see it, close the board manager and open it again.

Installing the SparkFun SAMD Boards

Once the board is installed, you should see the new entries in your Tools > Board list. Select the Argolis Wireless One.

Finally, select your SAML21 Board’s port. Navigate back up to the Tool > Port menu. The port menu may know which of your ports are the SAML21 board. On a Windows machine, the serial port should come in the form of “COM#”. On a Mac or Linux machine, the port will look like “/dev/cu.usbmodem####”.

As with any development board, if you can blink the RGB LED, you are on your way. Once you’ve verified that the IDE is all set up, you can start exploring the world of the ATSAML21.

Troubleshooting: Dual Serial Ports

One global issue to be aware of is that each SAML21 Board appears to your computer as two USB devices, and your computer will assign two different port numbers to your SAML21 Board – one for the bootloader, the other for the sketch.

When you hit upload, the Arduino IDE will reset your SAML21 board, then look for a new COM port to enumerate on your computer, which it assumes is the bootloader device. After some time waiting, if it doesn’t see a new port appear, Arduino will try sending code to the port you’ve selected.

Troubleshooting: Serial Port Not Appearing in Port Menu

If your SAML21 board is plugged in – power LED illuminated – but it isn’t appearing in your Arduino port list, first of all, make sure you have the drivers installed (Windows computers only). Then follow these steps to see if you can get the port back:

  1. Close all Arduino windows. (Don’t forget to save!)
  2. Unplug SAML21 Board from your computer.
  3. Wait a few seconds for the device to be detached.
  4. Plug SAML21 Argolis Wireless One back in.
  5. Open Arduino, check the Ports menu again.

Troubleshooting: Upload Fails or Freezes

If a sketch upload is taking longer than usual, or fails entirely, try resetting into the bootloader and uploading directly there. If the SAML21 is in bootloader mode, you may need to re-select your port – this time selecting the bootloader port.

Closing the serial monitor before uploading may also make for more reliable uploading.

Connect To the Things Network

If you want to connect with the Argolis Wireless One to The Things Network follow these steps.
Create an account on TTN:
https://account.thethingsnetwork.org/users/login
Schermafbeelding 2016-08-31 om 10.09.45
Login to the dashboard
Schermafbeelding 2016-08-31 om 10.10.03
Create an application for yourself, for example Argolis Wireless One
Schermafbeelding 2016-08-31 om 10.10.22
Register device.
Schermafbeelding 2016-08-31 om 10.10.42
Disconnect power from the Argolis Wireless One.
Connect it to your pc over usb.
Open a serial monitor within 30 seconds.
If you don’t receive any data within 2 seconds, press Enter.
Type the command: “EUI” and press Enter

Copy the DevEUI to the website, and press Register.

Schermafbeelding 2016-08-31 om 10.11.24

Copy the App EUI and App key to the Argolis Wireless One.
Change OTAA to 1 (otaa=1)

Schermafbeelding 2016-08-31 om 10.14.51

Your device is connected to the Things Network

Please find more information on:
https://www.thethingsnetwork.org/wiki/Backend/Connect/Application

Connect to the KPN network

First make sure that you have your keys from KPN. Login to the Device Manager. All credentials like URL, Username and password can be found in the email from KPN.

Right Click on Devices -> Create Device
Schermafbeelding 2016-08-31 om 10.41.32

Fill in the Form: For the Application Session key: Press add, double click on the 00000000000000 and paste your key. Change the Port to 1. Press update to save the settings.
Schermafbeelding 2016-08-31 om 10.42.50

Disconnect the power source from the Argolis Wireless One.
Connect the Argolis Wireless One to the usb.
Open a serial monitor within 30 seconds.
If you don’t see any data within 2 seconds, press Enter.
Set the DevAddr, AppSKey and NWSKey.