Giter VIP home page Giter VIP logo

Comments (4)

sqall01 avatar sqall01 commented on June 11, 2024

The protocol for the FIFO is defined here: https://github.com/sqall01/alertR/wiki/Protocol#protocol_schematics_fifo_sensor_sensoralert. There are also command lines to trigger an alert. But I think you already looked there.

In the scripts_example directory inside the installation there is the file mac_address_whitelist.py which contains also an example how to write into a FIFO file directly (actually, now when I see this I do not know why I did not use the json module ... definitely have to change this).

When you would use the json module of python for this script it would look something like this:

import json

fifo_dict = dict()
fifo_dict["message"] = "sensoralert"

payload = dict()
payload["state"] = 1
payload["dataType"] = 0
payload["hasLatestData"] = False
payload["changeState"] = False
payload["hasOptionalData"] = True

optional_data = dict()
optional_data["message"] = "Something I want to tell someone."
payload["optionalData"] = optional_data

fifo_dict["payload"] = payload

with open("/your/fifo/file", 'w') as fifo_file:
    fifo_file.write(json.dumps(fifo_dict))

Is this sufficient for now? Or do you have problems somewhere else?


Regarding the upload page. I actually thought about it. For example I thought about creating a subreddit alertr for everyone who wants to post something alertr related like tutorials or cool setup ideas. Another idea I had was to create an AlertR misc github repository and anyone with something cool can add it there via a pull request. However, since no one seemed to be interested until now, I did not pursue it further. Personally I think the subreddit would be a better choice since it is like a internet forum software. What do you think?

Cheers
sqall

from alertr.

sqall01 avatar sqall01 commented on June 11, 2024

Hi,

I added new Developer Tutorials to the Tutorials list in the wiki. The tutorial showing how to write a script for a FIFO sensor is placed here

Since this should answer your question, I will close this issue. However, if you have any further questions or a suggestion on the question of my last post post feel free to open it again.

Cheers
sqall

from alertr.

cerikss8 avatar cerikss8 commented on June 11, 2024

from alertr.

sqall01 avatar sqall01 commented on June 11, 2024

Hey, just to let you know. I just created a subreddit where everyone can post there tutorials.

Cheers,
sqall

from alertr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.