May 18, 2024, 05:31:20 AM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


Reading all inputs across multiple networked Hc-8's

Started by gadget-evilusions, April 25, 2015, 03:47:14 AM

Previous topic - Next topic

gadget-evilusions

I don't even know where to start with this one, so I will explain what I want to do.

I want to use 1 to 20 HC-8's, networked together, monitoring all inputs across all boards.

When one of the buttons or sensors, hooked to one of the many inputs is closed, I need an output device, hooked to what I will call the 'master' controller, to be able to indicate to me which of the 8-160 inputs is triggered. I do not know what type of output device is ideal, but I'd love to be able to get a push notification on my iphone to indicate which button is pressed.

Please tell me if what I am asking is ridiculous, or if it is possible, what additional information I would need to provide.
Brian
Evilusions LLC
www.evilusions.com for all your pneumatic components

JonnyMac

April 25, 2015, 07:09:20 AM #1 Last Edit: April 25, 2015, 07:11:02 AM by JonnyMac
The networking between HC-8s is not problem, we have the RS-485 port for that. The master controller would be setup to do round-robin polling of the slave devices. A little bit of work, but not hard -- in fact, I'm with a client in Illinois this week that often networks HC-8s together, and I just recently wrote a new master/slave system that uses a parsing engine I created for our products. The nice thing about the parsing engine is that it uses text, so you can do things in plain English.

For example, the master could send a status command like this:

CMD 1 INPUTS

This a request for the inputs from unit #1 (set via the DMX switch). If IN3 was the only thing active, it would respond like this:

RESP 1 INPUTS %00001000

Notice how the command and reponse messages look very simillar; this makes things easy. Again, you can test commands using a terminal, then write code to do the rest -- something like this to send the request to any unit:

pub request_inputs(device)

'' Send inputs request string

  rs485.str(string("CMD "))
  rs485.dec(device)
  rs485.str(string(" INPUTS"))
  rs485.tx(13)                                                   ' commands MUST be terminated with CR


The main loop of your program would be looking for inputs from the RS-485 system and parsing them out. That's a little more involved but I know how to do it -- I have done it.

Getting remote inputs via RS-485 is no problem, just a bit of code. Getting a message to your iPhone is another ball of wax and I don't have a solution. I have been experimenting with Android control via Bluetooth, but that doesn't work for iPhone and would not be appropriate, anyway. A possibility is having the master HC-8+ connect to a WiFi network and then use that to get a message to a phone app. Again, this latter part is a beyond my present experience.
Jon McPhalen
EFX-TEK Hollywood Office

bsnut

Thanks for posting this question Brian. I was thinking about doing something like this with the HC-8's since it opens alot of doors. It also puts everything on the HC-8 to full use.

QuoteA possibility is having the master HC-8+ connect to a WiFi network and then use that to get a message to a phone app.
If you want to connect to a WiFi. Parallax has a board called the Spinneret, this is web server board using the Propeller chip as the core processor. This will allow you to serve a web on your iPhone, where you can control your I/O over a Ethernet connection.

Jon, do you have this Object file that you can share with us. I would like to get a copy of it.
William Stefan
The Basic Stamp Nut

JonnyMac

Jon McPhalen
EFX-TEK Hollywood Office

bsnut

Sorry, I though you knew what I was referring to. The one I'm referring to is this one that you are talking about here.
QuoteI just recently wrote a new master/slave system that uses a parsing engine I created for our products.
Is this parsing engine just a butch methods or is it a object file that you created for this customer?
William Stefan
The Basic Stamp Nut

JonnyMac

It's an object -- you can read all about it in the April issue of Nuts & Volts. Wait... it's the end of April, Wlliam; you mean to tell me you haven't read and absorbed my column yet?! :)

Here's a basic parser demo (which gets you the latest version of my objects that runs on the HC-8+). For real fun, you can switch from the terminal input (through the programming port) to a Bluetooth radio and do remote control. I have used the parsing engine to let the master and slaves in a networked system process text-based messages that are going back and forth. By using text, we humans can spy on the works more easily than if it was binary data.

I am on day 9 of a nine-day programming adventure with an EFX-TEK client; the parser is being used in their product, as well as many of the other libraries used in the demo. That is to say that they've been pretty well wrung out.
Jon McPhalen
EFX-TEK Hollywood Office