Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

The Raspberry Pi is a hugely popular, inexpensive, credit card-sized Linux computer. We detail how we've used it as a Gateway for a SmartMesh IP network.


Prepare the Raspberry Pi

  • We use the Raspberry Pi model B
  • Install Raspbian (as part of NOOBS, we use NOOBS 1.3.9)
  • If are connecting your SmartMesh IP Manager through the UART pins:

    You do not need to do these steps if you plan on connecting your SmartMesh IP Manager over USB.


    By default, the Raspberry Pi uses the UART pin as a command line interface for Linux. After the first boot, you need to configure Linux to not use those pins:

    • In /etc/inittab, replace

       

      with

       
    • In /boot/cmdline.txt, replace

       

      with

       
    • Reboot the Raspberry Pi so these changes take effect

       

Hardware Connections

You do not need to do these steps if you plan on connecting your SmartMesh IP Manager over USB.

We are connecting the serial API port of the SmartMesh IP manager to the UART on the Raspberry Pi.

Pinout of the Raspberry Pi header:

3.3V125V
I2C0 SDSA34DNC
I2C0 SCL56GND
GPIO478UART TXD
DNC910UART RXD
GPIO 171112GPIO 18
GPIO 211314DNC
GPIO 221516GPIO 23
DNC1718GPIO 24
SP10 MOSI1920DNC
SP10 MISO2122GPIO 25
SP10 SCLK2324SP10 CE0 N
DNC2526SP10 CE1 N

Connections between the Raspberry Pi and DC9003 SmartMesh IP Manager

Raspberry Pi pinDN9903 pin name (silkscreen)
GNDGND
3.3VVBAT
UART TXDRX
UART RXDTX
GNDTX CTSn
GNDRX RTSn


Happy together

Install DustLink

The Raspberry Pi comes with Python 2.7, so you can run any application developed using the SmartMesh SDK. Here, we will run DustLink:

  • Download the latest release from https://github.com/dustcloud/dustlink/releases on your computer, as a zip file.
  • Transfer it to your Raspbery Pi, for example using SCP.
  • Enter the following commands to install DustLink (you only need to do this once)

     
  • Start DustLink

     
  • In your browser, open http://<your_raspberry_pi_ip_address>:8080/

Configure DustLink

  • Log into the web interface using:
    • username: admin
    • password: admin
  • Navigate to Managers
  • Under the Add section, enter /dev/ttyAMA0 and press Enter. After 10s, this connection is active
  • Refer to the DustLink documentation for information on using DustLink.

Start DustLink on boot

  • Install screen:

     
  • Create file /home/pi/startDustLink.sh with the following content:

     
  • Change ownership and permission for that file and the DustLink folder:

     
  • Have cron start DustLink on reboot:

     

    then, add the following line:

     
  • Reboot the Raspberry Pi

     


Note Well

 Raspberry Pi is a trademark of the Raspberry Pi Foundation. See http://www.raspberrypi.org/ for details.

  • No labels