- Setup Docker and Docker-Compose for your operating system
- Navigate to the ./docker folder and run the followinng command
docker-compose up -d
- Navigate back to the root directory of this project and run the following command to install dependencies.
Node V14 needed
yarn install
#or
npm install
- Edit the ./.env.example file with your Africa's Talking credenntials as detailed below in the Heroku setup.
Note by default REDIS_URL is redis://127.0.0.1:6379
- Rename ./.env.example to
.env
- Run the app by executing
yarn run dev
ornpm run dev
- You can view what's being stored in Redis by navigating to http://localhost:7843 and setting redis host as
redis
.
- Create a free Heroku account if you do not have one
- Click on
button to bootstrap the app
- Give your app a name
- Under your Heroku Config Vars section add the following variables (see the screen grabs below for more info):
APPLICATION_USERNAME
: Your IoT Application usernameDEVICE_GROUP
: The device group you want to authenticate toDEVICE_PASS
: The password assigned to the device groupSERVO_TOPIC
: The topic to which the IoT device is listening to for servo motor control. Example if your base topic iscoolguy/devicegroup/#
and the IoT device is listening for servo motor control command atcoolguy/devicegroup/servo
then this value should beservo
.LED_TOPIC
: Same as above but for LED controlAT_USERNAME
: Preferrablysandbox
AT_APIKEY
: Your sandbox API KEYIOT_APIKEY
: Your live application API KEY
Note : If you need to modify them later see below screen grabs on where to get them
![]()
Your application URL is under the "Domains" section. Should read
https://<appname>.herokuapp.com/
- In your Sandbox account, navigate to the USSD blade and click on "Create Channel"
- In the channel creation form, add an USSD shortcode number, and in the callback URL field add the your app URL and append
ussd
. Example if your Heroku app url in 4 above ishttps://mycoolapp.herokuapp.com/
then your USSD callback should behttps://mycoolapp.herokuapp.com/ussd
. - Save and in the end you should have something like shown on the screen grab below
- Inside your AT IoT account, Click on the
...
under theActions
tab for the device group you'd like to configure the callback for and update the callback URL toiot
. Example if your Heroku app url above ishttps://mycoolapp.herokuapp.com/
then your IoT callback should behttps://mycoolapp.herokuapp.com/iot
.
- Navigate to the AT Sandbox Simulator page. Enter a valid phone number.
- Click on the USSD option
- Dial your USSD code. If your short code above was 1000, enter
*384*1000#
and press theCall
button for magic!
- Create an issue or send a PR