Research
From Glacsweb Wiki
Contents
MSP430
Useful reading
SimpliciTI
Overview
For help setting up Code Composer to use SimpliciTI see [1]
- Low power - proprietary network protocol
- Low cost - uses < 8K FLASH, 1K RAM
- Flexible - simple star and/or p2p Example Topology
- Simple - uses very basic core API
- Versatile - many different boards supported
- Low power - supports sleeping devices
Network Devices
- Access Point
- Star hub in the network (1/net)
- always-on
- store and fwd for sleeping devices
- Range Extender
- always-on device
- limited to 4/net
- End Device
- poll for data
- API sequence (eg)
- Init (and Join)
- Link (assumes listen)
- Sample Temp
- Send
- Option to sleep
End Devices
- Two approaches to getting messages
- Polls AP (Requires AP!)
- Listens for activity then stays awake and looks for frames destined for it
Architecture
- Layers
- MRFI ("Minimal RF Interface") 'Physical'
- NWK 'Network'
- Applications, customer and nwk
- Network Support
- init
- ping
- link/linklisten
- nwk mgmt
- send/receive
- I/O
Components/simpliciti/nwk_api.h
Supports initialization, linking (bi-directional by default), peer-to-peer messaging (SMPL_Send/Receive), configuration (SMPL_loctl)
smplStatus_t SMPL_Init(uint8_t (*)(linkID_t)); smplStatus_t SMPL_Link(linkID_t *); smplStatus_t SMPL_LinkListen(linkID_t *); smplStatus_t SMPL_Send(linkID_t lid, uint8_t *msg, uint8_t len); smplStatus_t SMPL_SendOpt(linkID_t lid, uint8_t *msg, uint8_t len, txOpt_t); smplStatus_t SMPL_Receive(linkID_t lid, uint8_t *msg, uint8_t *len); smplStatus_t SMPL_Ioctl(ioctlObject_t, ioctlAction_t, void *); #ifdef EXTENDED_API smplStatus_t SMPL_Ping(linkID_t); smplStatus_t SMPL_Unlink(linkID_t); smplStatus_t SMPL_Commission(addr_t *, uint8_t, uint8_t, linkID_t *);
Addressing and Communication
- net address = hw addr (4 byte) + app port
- statically assigned hw address
- no address resolution mechanism
- byte 1: 0x00, 0xFF - reserved for broadcast
- Can communicate through RE/AP or to neighbours
- When debugging it is important to make sure the devices have addresses set :
- Up to this point, no changes have been needed to any SimpliciTI source code or configuration files. The first device was built and programmed with “out-of-the-box” settings. In order to build another LinkTo device for this sample application, one change must be made to the smpl_config.dat file. Each SimpliciTI device must have a unique address – the address shown below is the one that was used for the first LinkTo device. Before building another device, change the value of THIS_DEVICE_ADDRESS – the first byte is suggested, like, from 0x78 to 0x87.
Broadcasting
- Can be done using the "Unconnected User Datagram" protocol
- Still uses links but it's a special reserved link that everyone can send/listen on
SMPL_Send(SMPL_LINKID_USER_UUD, ...) SMPL_Receive(SMPL_LINKID_USER_UUD,...)
- Need to remember to switch the receiving node into RX mode, not done by default as uses lots of power!
- An ioctl call can be used to enable/disable
- Examples and troubleshooting
Additional Details (Potential Problems)
- minimal hw abstraction
- no driver support (UART, SPI, LCD, Timers)
- no heap utilization
- no runtime context storage
- simple thread, no tasks or scheduling
- nwk api is synchronous
- retries and acks must be managed by app
- "The SimpliciTI API should not be considered thread-safe or re-entrant"
- No routing mechanism is supported, only works by the addresses given to the devices
Development Tools
Components/simpliciti/nwk.h
smplStatus_t nwk_nwkInit(uint8_t (*)(linkID_t)); connInfo_t *nwk_getNextConnection(void); void nwk_freeConnection(connInfo_t *); uint8_t nwk_getNextClientPort(void); connInfo_t *nwk_getConnInfo(linkID_t port); connInfo_t *nwk_isLinkDuplicate(uint8_t *, uint8_t); uint8_t nwk_findAddressMatch(mrfiPacket_t *); smplStatus_t nwk_checkConnInfo(connInfo_t *, uint8_t); uint8_t nwk_isConnectionValid(mrfiPacket_t *, linkID_t *); uint8_t nwk_allocateLocalRxPort(uint8_t, connInfo_t *); uint8_t nwk_isValidReply(mrfiPacket_t *, uint8_t, uint8_t, uint8_t); connInfo_t *nwk_findPeer(addr_t *, uint8_t); smplStatus_t nwk_NVObj(ioctlAction_t, ioctlNVObj_t *); uint8_t nwk_checkAppMsgTID(appPTid_t, appPTid_t); void nwk_getNumObjectFromMsg(void *, void *, uint8_t); void nwk_putNumObjectIntoMsg(void *, void *, uint8_t); #ifdef ACCESS_POINT sfInfo_t *nwk_getSFInfoPtr(void); #ifdef AP_IS_DATA_HUB uint8_t nwk_saveJoinedDevice(mrfiPacket_t *); connInfo_t *nwk_findAlreadyJoined(mrfiPacket_t *);