SwitchMote Communication

Started by peckcj, January 24, 2016, 02:05:34 AM

peckcj

I have my Switchmote 2X10A installed and communicating with the gateway. The only issue I have is that I cannot control the switching from the web interface. The ON/OFF display is there and they correspond correctly when it is manually switched, but I cannot control them remotely.

Is there some other type of setup on the backend that needs to be configured?

Felix

It doesn't need anything else. As long as you pick the right type of node, it should show you the middle button automatically, and the other 2 if you press them on the Switchmote.
And it should be 2 way right away.
You will need to see where the communication is breaking. Try to move closer just to make sure the SwitchMote can receive the signal from your gateway.

peckcj

The interface looks correct, and the buttons correspond correctly when the switch is physically operated, but the switchmote does not respond remotely. I moved it right next to the gateway with no response.

When I attempt to send a BTNx:y command through the terminal on the web interface, it still does not operate.

If I puTTy into the switchmote and send it a command it shows nothing either. Can anybody recommend a way I can directly send a command from the pi/mighty hat?

Felix

I understand you're using a MightyHat?
If so here's what you can do, plug an FTDI adapter into the FTDI header while it is running. (To be safe and avoid ground loops, ensure the voltage differential between the FTDIAdapter GND and your computer USB port GND is very negligible.)
Then plug the FTDIAdapter output into a PC:


Then open that serial port which will basically sniff all the serial traffic from the Pi into MightyHat. Below are sample messages from the GUI to request a SwitchMote to turn ON/OFF:



So that's what you should see.

peckcj

OK, so when I press any of the buttons in the web interface, the commands are not being sent to the gateway to send out. I'm also having a problem with my Switchmote PSU not responding remotely, so I am thinking that the MightyHat is not sending anything out.

Felix

You reported that the interface is responding when you press the SwitchMote button. That means the MightyHat receives the RF packet and serially forwards it to the Pi which then is picked up by the gateway app. So the serial connection is there - at least the Moteino TX to Pi RX.
The only possible issue would be the Pi TX to Moteino RX could have some issue, either a broken connection or some short, but I can hardly imagine that. If you could do this: disconnect your MightyHat and test the RX/TX lines for continuity between the Pi header and the FTDI header. I assume you can program your MightyHat via FTDI header, that means the RX/TX between that header and the atmega chip is solid. What we need to confirm is the RX/TX are also solid to the Pi header pins (#8 and #10):


peckcj

There is continuity from the pi GPIO and the FTDI header. I swapped out the pi with another that I have on hand, but it's the same issue.

Felix

Short of doing a return can you do any other debugging, check for shorts to VCC/GND?
I am sure its something very minor. Anyway if you want to return it to me I can take a look.

peckcj

I'll play around with it this weekend. I'll check over all the connections with my trusty magnifying visor. If I can't find anything obvious, I'll let you know.

Thanks for the help, I'm learning a ton of stuff!!

Felix

It would be interesting to try to program the MHat through the FTDI, except connect TX/RX (in the right order, TX to RX and not TX to TX etc!) from the Pi Header side. That way you would verify that the Pi header serial has solid traces into the atmega328. Then your problem is somewhere else, not on the MightyHat hardware.
So you'd need a few male-female jumper wires to do this FTDI routing.

peckcj

I set it up thorough the header that goes to the pi (picture attached), and I was able to program it okay. I also checked my connections on the radio to see if they were good, and they look okay.

Maybe I'll send it back to you and you can check it out. I must be missing something.

Felix

Yup if that just worked, then I have strong confidence that the serial between the Pi and MHat is good.
Looking back I think it's some software disconnect somewhere. Please ensure you are running latest sources of everything.
The FTDI sniff test i illustrated above could also help prove if the Pi is communicating anything to MHat.

peckcj

I'll re-image the sd card this weekend and post the results.

Felix

Before you go through that trouble, I would simply debug the Pi's GPIO serial port. Connect it through a known good FTDI adapter to your PC, open terrminals in both places (stop the gateway with sudo stop gateway and open minicom on the Pi). Then send something from one to the other and vice versa. Messages should show on the other end (ensure both have the same baud, etc).

peckcj

OK, I have both the MightHay and the pi open in puTTy, with minicom open on the pi, but I don't know how to send commands via the terminal in minicom or puTTy . I cannot type anything except ctrl-A. When I type, nothing happens.