Skip to content

cxcco/MQTT-S-Gateway

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 

Repository files navigation

MQTT-S Gateway over XBee

Documents in TomyGateway directory will help you to understand the architecture of this program.
Raspberry Pi can run this Gateway.
http://www.youtube.com/watch?v=INa5YznfR-8&feature=youtu.be

outlook

Supported functions

  • QOS Level 0 and 1
  • CONNECT, WILLTOPICREQ, WILLTOPIC, WILLMSGREQ, WILLMSG
  • REGISTER, SUBSCRIBE, PUBLISH, UNSUBSCRIBE, DISCONNECT
  • CONNACK, REGACK, SUBACK, PUBACK, UNSUBACK
  • ADVERTIZE, GWINFO

Usage

####1) Minimum requirements

  • Three XBee S2 devices, one coordinator, one gateway and one client.
  • Linux ( Windows can not execute this program.)
  • pthread, rt liblaries to be linked.

####2) How to Build

$ make

Makefile is in TomyGateway directory.
TomyGateway (Executable) is created in Build directory.

####3) Start Gateway

$ TomyGateway 1 /dev/ttyUSB0  ["localhost"] [1883]

argv 1: Gateway Id (numeric 1 - 255)
argv 2: Device which XBee dongle connected
argv 3: Broker IP Address ( default value "localhost" )
argv 4: Port No ( default value 1883 )

XBee configurations

Serial interfacing of gateway.
Coordinator is default setting.

[BD] 6   57600 bps
[D7] 1   CTS-Flow Control
[D6] 1   RTS-Flow Control
[AP] 2   API Enable

Other values are defaults.

RaspberryPi instalation

####1) Prepare Bootup SD card

####2) How to connect XBee to RaspberryPi RaspberryPi XBee
3.3V Pin 1 ---------- Pin 1 Vcc
GND Pin 6 ---------- Pin 10 GND
Tx Pin 8 ---------- Pin 3 Rx
Rx Pin 10 ---------- Pin 2 Tx

####3) How to start

  • Boot up RaspberyPi & login via ssh.
    $ ssh 'RaspberryPi IP Address' -p 22022 -l gw
    password is gw.
    Raspberry IP address is asigned by DHCP.

  • Change gw password. (gw can use sudo command)
    root's password is root.

  • Invoke Gateway
    Invoked automatically by systemd.
    How to stop the automatical invoke.
    > sudo systemctl disable tomygateway.service
    How to start the gateway by manual operation.
    > ./TomyGateway.sh
    or
    > ./TomyGatewaySilent.sh

     check the shell script for more information     
     IP address 85.119.83.194 is test.mosquito.org.
    

###Contact

About

MQTT-S Gateway over XBee S2

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 98.1%
  • C 1.4%
  • Makefile 0.5%