Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get bridge to talk to Netcat to send commands via mochad #458

Closed
instructor1361 opened this issue Feb 10, 2017 · 27 comments
Closed

Can't get bridge to talk to Netcat to send commands via mochad #458

instructor1361 opened this issue Feb 10, 2017 · 27 comments

Comments

@instructor1361
Copy link

Probably not a bridge issue as much as a user issue but I'm trying to get the bridge to send netcat commands via mochad. NC from the terminal works fine as does a remote nc session. Would like examples of the proper command syntax to configure in the bridge GUI. Have used the bridge successfully with windows and Mint 18 via a firecracker module but can't figure out the proper command structure to get it to communicate via Netcat to a CM19A X10 module.

Searched the forums to no avail, any assistance appreciated.

@instructor1361 instructor1361 changed the title Can't get bridge to talk to mochad to send Netcat commands Can't get bridge to talk to Netcat to send commands via mochad Feb 10, 2017
@bwssytems
Copy link
Owner

bwssytems commented Feb 11, 2017

The target item should be tcp://192.168.X.X:1099/pl a1 on and the type should be TCP Device.

@instructor1361
Copy link
Author

Thanks for the response but still no go. Command generates no errors but still no comm to Netcat. If this helps my platform configuration is all on same PC:
Mint 18
Mochad 0.1.17
HA-Bridge 4.1.3 (Tried in older 3.5.1 as well)
Settings in Bridge
Name=Testlight
Inactive and No state.. blank
Target= default
Device Type = TCP
Map Type = Blank
MAC Addr for HUe = per system
Map ID = per system 1111
On Items Settings
Type = TCP Device
Target Item = tcp://192.168.1.240:1099/rf a1 on
Remaining On items left at default

Request executed success shown when using test button

@bwssytems
Copy link
Owner

I have tested this again and it is working.

@instructor1
Copy link

Not sure what the issue is but it doesn't work for me. Anyway, got tired of tweaking on it to no avail so I installed Domoticz and let it be the mediator. Works great and your Domoticz configuration tool works flawlessly and saves a lot of typing too! Thanks for the follow-up and the great application. BTW I'm using my Echo Dot to voice manage the lighting through the bridge and that works great too.

@bwssytems
Copy link
Owner

Yes, tested some more and now it is inconsistent. Will look some more.

@instructor1361
Copy link
Author

instructor1361 commented Feb 23, 2017 via email

@bwssytems
Copy link
Owner

I have an enhancement that may help in the next release

@bwssytems bwssytems added this to the V4.2.1 milestone Mar 6, 2017
@instructor1361
Copy link
Author

Thank you,

I just ordered a Raspberry Pi to try this in. I'll give it a go with 4.2.1.

@bwssytems
Copy link
Owner

Well, I have to do some other fixing, it seems mochad needs a \n, \r or \0 for it complete the line read. Unless you send a hex string, i encode those as characters and not to the actual byte value.

@instructor1361
Copy link
Author

Received the Pi3 yesterday, installed Mochad and Ha-Bridge 4.2.1, used TCP device command as tcp://192.168.1.240:1099/rf a1 on. No error indicted from the Bridge but no comm with Mochad either. Using Netcat command rf a1 remotely to, and locally on the Pi work fine. Any suggestion on how else o test comms between the bridge and mochad?

@bwssytems
Copy link
Owner

You need to put a \n after that command

@instructor1361
Copy link
Author

instructor1361 commented Mar 12, 2017 via email

@instructor1361
Copy link
Author

instructor1361 commented Mar 12, 2017 via email

@bwssytems
Copy link
Owner

Mochad expects that a CR LF or null to be passed at the end of the string. When using netcat, when you hit the return key it sends the CR or \n character.

@instructor1361
Copy link
Author

instructor1361 commented Mar 12, 2017 via email

@audiofreak9
Copy link
Collaborator

I wrote a tutorial for X10 that gives X10 dimming examples here: http://coreyswrite.com/electronics/home-automation/amazon-echo-x10-home-control-updated/

@Matt8119
Copy link

@audiofreak9 in this write up, is the process involving the ha-bridge still the same as you described?

@instructor1
Copy link

Thanks Corey, not using Heyu, sending X10 commands directly from the HA-Bridge via TCP to Netcat to execute in Mochad. Mochad is talking to the X10 transceiver via a USB port. Until the latest update (4.2.1) I couldn't get the bridge to talk to Netcat so I had installed Domoticz as a go between to send the commands from the bridge to Mochad. This worked great but the fix now allows me to send directly from the bridge to Mochad via Netcat using TCP device type. (e.g. tcp://192.168.x.x:1099/rf a1 on)

@audiofreak9
Copy link
Collaborator

@Matt8119 yes, just use the updated ha-bridge v4.2.1, otherwise my tutorial for X10 control is up to date.

@instructor1 nice, I'm planning on playing with some TCP myself, so yeah my tutorial uses obdim "On, Full Bright, Dim %", which is a HEYU command, but this works nicely with the ha-bridge's state memory. You can just use MOCHAD's dim, nearly the same. Power-line is pl <H><U> dim <Dims> and RF is rf <H><U> dim.

@audiofreak9
Copy link
Collaborator

@Matt8119 BTW, I've even bricked an RPi in the past and followed my own tutorial building a new ha-bridge, just to be sure my steps still work.

@audiofreak9
Copy link
Collaborator

@instructor1 Just a thought if the ha-bridge and the USB X10 transceiver are on the same RPi, then you can call the MOCHAD directly on the ha-bridge with the exec type, essentially replacing HEYU with MOCHAD in my tutorial.

@instructor1361
Copy link
Author

instructor1361 commented Mar 12, 2017 via email

@audiofreak9
Copy link
Collaborator

I'm gonna have to get my test RPi B+ out, install MOCHAD and test it out. However, using the EXEC type is very straight forward - even in the newest GUI.

@instructor1361
Copy link
Author

instructor1361 commented Mar 13, 2017 via email

@enishoca
Copy link

enishoca commented Oct 7, 2017

I got this working on 4.5.6 with the following settings
Set the Map Type to TCP Device
Set the command type to TCP Device
set the Item field to "tcp://127.0.0.1:1099/rf a1 on \n" without quotes

@instructor1
Copy link

instructor1 commented Oct 9, 2017 via email

@enishoca
Copy link

enishoca commented Dec 17, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants