Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CQC controlling Model Railroad???
#41
If there are any relatively tight timing requirements involved, it might be better to let the Arduino handling the details locally and let CQC be the control and observation point, instead of letting CQC handle low level hardware details. Though you could certainly do the latter if you wanted.

I guess it depends somewhat on how you debug code on the Arduino. If it's really difficult to do, and there's a long turnaround to make changes, get them loaded and test/debug them, it might be a lot easier to do it on the CQC side where you have a pretty reasonable debugging environment.
Dean Roddey
Explorans limites defectum
Reply
#42
(01-13-2017, 10:25 AM)Dean Roddey Wrote: I guess it depends somewhat on how you debug code on the Arduino. If it's really difficult to do, and there's a long turnaround to make changes, get them loaded and test/debug them, it might be a lot easier to do it on the CQC side where you have a pretty reasonable debugging environment.

that is one of the nice things about arduino... in the IDE you edit your code, I believe it may do some quick spelling checks/syntax check, you press a button and it sends your new code to the arduinio, reboots it and you are up and running in seconds...
so changes are quick and easy...
NOTE: As one wise professional something once stated, I am ignorant & childish, with a mindset comparable to 9/11 troofers and wackjob conspiracy theorists. so don't take anything I say as advice...
Reply
#43
Yes, I'm finding the Arduino very easy to work with.  I'm leaning towards that approach, letting Arduino do much of the work, and use CQC more for the just UI, unless needed for more.

BTW, I heard from karenlee.  She was never able to get it to work.  Couldn't establish communication.

Mike
Reply
#44
OK Skimmed the conversation. This is why I said MQTT.

A CQC MQTT driver conceptually would be a driver that loads a file of field names and types. CQC would then listen to the broadcast from the MQTT server and update the driver fields. CQC would also be able to send data to the MQTT server which would rebroadcast them and the Arduino sketch would see that change and update the outputs as required.

It is very simple stuff really. There is a MQTT library available and it become something as simple as defining the name of the output (let call it "switch_1") and then the sketch waits until it sees a command that says switch_1 on. A simple if statement says if off turn on if on do nothing.

By going down the path of a MQTT drier it allows for anyone to make a fairly standardized arduino sketch that would not only integrate with CQC quite quickly, but also many other platforms because its using a standard.

Yes, I have a personal reason for pushing MQTT, I am experimenting with the ESP8266 board and SONOFF switches etc, and MQTT makes the most sense. I could jerry rig my own protocol like you guys are talking about but that is just wasted man hours for something that is not re-usable.

So, to me, MQTT gives you the simplest and most felixble option to achieve the control of the railroad from your iPad via CQC.
Mykel Koblenz
Illawarra Smart Home
Reply
#45
We now have the Arduino on the local network with an IP address.  The CQC driver defaults to Port 9999.  Is that the correct port to be using to try and make connection via an IP address?
Reply
#46
That depends completely on the software on the Arduino side. There's nothing there that's waiting for the driver to connect to it. Assuming you are loading your code to the Arduino, it should listen on some port, and the driver should be set to connect to that port.
Dean Roddey
Explorans limites defectum
Reply
#47
I was wondering if that wasn't the approach. The Arduino is sort of like a person with an empty head.
Reply
#48
yes, exactly. You need to write how its going to respond to CQC and how its going to send data to CQC. It is a blank canvas and you are the artist that needs to create.

In your sketch you will need to setup the IP and port information and then what format you will be sending data in (ASCII or HEX) and then write all the code for all the different scenarios.

yes, exactly.  You need to write how its going to respond to CQC and how its going to send data to CQC.  It is a blank canvas and you are the artist that needs to create.

In your sketch you will need to setup the IP and port information and then what format you will be sending data in (ASCII or HEX) and then write all the code for all the different scenarios.
Mykel Koblenz
Illawarra Smart Home
Reply
#49
Well now, this should take care of the relay need, up to 2024, now to interface to CQC...

Raspberry Pi and RS485 Relay Output Modules
Reply
#50
RS485 is just like RS232 except its multi-dropped (i.e. not a point to point).  You dont need the Pi - a Ethernet to RS485 would do it, or a RS232 to RS485 will also work.

You still need to know the protocol for controlling the relays - which in this case is Modbus over RS485 (and a modbus driver has been written for CQC, a little rough though so your mileage may vary).

How much is this board.  If it is close in price to the Click PLC Relay output boards I'd say go with the PLC instead.  By the time you buy the Pi, case power supply and the RS485 interface board and then relay boards you may be close to the same price for the PLC solution.

Basically

Click PLC 12VDC Relay Outputs - $79
8 Relay Outputs - $40
1.3A Power Supply - $39

PLC can run in just a slave mode where you turn on and off each output or you can have it run some logic with CQC in as a supervisory role.

Add up to 8 I/O module so you can get up to 70 relay outputs (6 + 8x8)
Mykel Koblenz
Illawarra Smart Home
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Controlling Insteon Scene Controller buttons ellisr63 8 5,863 10-14-2014, 11:38 AM
Last Post: SomeWhatLost
  Android Widgets directly controlling CQC! IVB 39 14,649 12-08-2013, 12:24 PM
Last Post: Dean Roddey
  Controlling ZigBee (or Z-Wave) on HAI anogee 2 2,456 12-18-2012, 12:06 PM
Last Post: Dean Roddey
  Controlling an onscreen GUI cavalier240 10 4,463 03-20-2012, 09:40 AM
Last Post: standon
  Onkyo TX NR708 Driver Model Choice jmwhooper 2 2,454 05-19-2011, 02:01 PM
Last Post: wdill
  Need help with controlling an app simon 26 10,414 11-28-2009, 01:42 PM
Last Post: sic0048
  Controlling devices that use HDMI-CEC cavalier240 4 3,227 09-26-2008, 05:25 AM
Last Post: sic0048
  CQC controlling VLC or MPlayer on Windows or Linux dkemme 2 2,280 02-25-2008, 09:49 AM
Last Post: dcpete
  Is 4s lag normal for CQC controlling CQS Audio player? Sendero 11 4,948 01-04-2008, 11:55 PM
Last Post: Dean Roddey
  controlling autopatch via rf? Providince 8 4,104 06-01-2007, 09:56 AM
Last Post: Dean Roddey

Forum Jump:


Users browsing this thread: 1 Guest(s)