Skip to content

A server manages messages to be sent to cactuspi-client.

Notifications You must be signed in to change notification settings

dannielum/cactuspi-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

103 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cactus Pi Server

A Raspberry Pi server to manage messages to be sent to the CactusPi Client.

Hardware Setup

  • Raspberry Pi

Services

  • Publisher
    • AWS SQS
    • PubNub
    • MQTT (Home Assistant)

Controllers

  • CommandManager

Built-In End Points

  • /hello - sends 'Hello World!' to cactuspi client
  • /message/:message - sends given message to cactuspi client
  • /start - sends start command to start the message queue on cactuspi client
  • /stop - sends stop command to pause the message queue on cactuspi client (can resume with start command)
  • /clear - sends clear command to empty the message queue on cactuspi client
  • /end - sends end command to stop and empty the message queue on cactuspi client

Plugins

Cactus Pi Server is importing the plugins from the Cactus Pi Service library. Some of the availale plugins are:

Set up plugin configs

Create your own plugins

Instructions

  1. Download cactuspi-server.
git clone https://github.com/dannielum/cactuspi-server.git
cd cactuspi-server
npm i
  1. Create config.json.
cd cactuspi-server
cp config.json.sample config.json
  1. Open config.json and set the address and port of the service.
  2. Replace the SQS, PubNub, or MQTT configs in config.json.
  3. Set pubsubType to sns, pubnub, or mqtt in config.json.
  4. Run
npm start

Debugging

To test if your server is running, run

curl localhost:8081/hello

Assuming you are running it on localhost with port 8081. You should see Hello World! is returned on the terminal if the server is responding.

About

A server manages messages to be sent to cactuspi-client.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •