Skip to content

Nordic NRF51 and FruityMesh RGB LED GPIO example using the Ping module and a timer-tick

License

Notifications You must be signed in to change notification settings

ihassin/fruitymesh-ping

Repository files navigation

img_3369 1

#FruityMesh

The FruityMesh project is under active development at M-Way Solutions GmbH, Germany.

#This repo

This clone of FruityMesh is for learning purposes and does not aspire to be a fork of FruityMesh.

##Goal

The goal was to use the Ping example as an introduction to mesh programming using the FruityMesh framework. The exercise is to have a module control an RGB LED to reflect its node's proximity to other nodes.

The LED is dimmed when disconnected from other nodes and turns green when its signal strength is high, orange when medium and red when low.

##Implementation

The LED is connected to GPIOs 18, 19 and 20. PingModule was added to the project and modified to support the Timer Tick callback, to check signal strength every second.

Using simple arithmetic, it changes the LED's colours based on the node's signal strength with its neighbours.

ezgif com-optimize

##Modified makefile

The makefile is slightly different than the one contributed by my colleague Tim Kadom in that it adds the Ping module and a goal to flash the device.

##Modified Ping Module

The original PingModule was adapted here.

The highlights of the changes are:

  • Include NRF GPIO support
  • Initialise GPIOs and timer values in PingModule::ConfigurationLoadedHandler
  • Implement the PingModule::TimerEventHandler method to send a ping to other nodes in broadcast mode.
  • Modified the PingModule::ConnectionPacketReceivedEventHandler method to control the LED's colours based on the absolute value of the sum of the RSSI values for all neighbouring nodes.

#Up and running

You are welcome to use my VM setup to quickly bring up a complete NRF51/FruityMesh development up and running to experiment with this exciting platform. If you are on a Mac, and want to develop directly from it, skip the VM building and try my Ansible set up for Mac OS X here.

#Other efforts

#Contributing

  • Fork it (https://github.com/ihassin/fruity-ping/fork)
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create a new Pull Request

Code of conduct

We adhere to the code of conduct as described here.

License

This repo adheres to the license as it is stated here.

About

Nordic NRF51 and FruityMesh RGB LED GPIO example using the Ping module and a timer-tick

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published