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?
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.
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?
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:
(http://i.imgur.com/R0uaFIQ.png)
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:
(http://i.imgur.com/mFSXRf8.png)
So that's what you should see.
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.
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):
(http://www.advamation.com/knowhow/raspberrypi/rpi-gpio-p1-labeled.png)
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.
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.
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!!
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.
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.
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.
I'll re-image the sd card this weekend and post the results.
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).
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.
If you wired it right, (TX to RX, and vice versa, common GNDs and VCCs), then when you type anything on one end it should show up on the other end. You have to make sure the ports are not used by anything else, if you're using my image or my setup then you gotta sudo stop gateway to free the serial port. Open minicom like this:
minicom -b 115200 -o -D /dev/ttyAMA0
You can just open serial monitor in the Arduino IDE, same 115200 baud etc. Type something hit ENTER, you should see that in minicom.
I have my FTDI adapter plugged directly into the MightyHat FTDI pins and my laptop. I open up the Arduino IDE and open up the serial monitor.
I SSH into the pi and stop the gateway. Then I open up minicom via SSH as well.
I can see the metrics showing up on the serial monitor in the Arduino IDE, and I can also see them show up in minicom via SSH.
When I attempt to send a command from the serial monitor, nothing comes up on minicom. When I type anything in minicom, nothing shows up on the serial monitor.
That is because if you plug it directly into the MHat FTDI header, then you can only talk to the atmega, ie essentially the FTDI adapter is now in parallel with the Pi serial. So to talk to the Pi instead, you have to reverse RX and TX, so you need to plug it with jumper wires.
Got it!! Thanks, Ill give it a shot.
I plugged in the FTDI adapter with RX and TX swapped into the MH, then SSHed into the pi, stopped the gateway, then opened minicom.
I typed into the serial monitor and hit send and got nothing on minicom.
Ok let me try that on my own when I get a chance today and I'll follow up. I want to make sure the theory corresponds to reality.
In any case what you describe is the serial INTO the Pi, which earlier I believe you reported that it works because yon can receive RF messages and through the mega to the pi to the gateway. So that part we know works and the fact that you can't do the same via serial monitor means something is not right somewhere, maybe a connection or something. Let me try this and I'll report back.
I removed the MightyHat and installed a Moteino with the gateway sketch on it, and it works fine, with full remote functionality.
It appears that the MH is not communicating properly. Can I send it back to you to check out?
Sure. Send me an email and I'll get you instructions for sending it back.
Thanks
I received the Mhat from you.
There is nothing wrong with the MHat. I reflashed it with the sample sketch and default encrypt key since it was different.
I used a Pi with the V8 image.
I used a SwitchMote2x10A with to test it. Everything works. The SM shows in the UI as soon as I press any of the buttons, then I can pick "LightSwitch" for the type and the buttons will become available, pressing one in the UI activates that button on the SMote.
So everything worked on my end. You will need to revisit your settings, load the correct sketch for the Switchmote also. It requires a config sketch to put the radio settings in EEPROM then the actual SwitchMote sketch.
The MigthyHat will be returned to you.
Well, thanks for checking on it. It's very strange how the MH isn't working for me, but a regular Moteino is...and they're both loaded with the same exact sketch. I guess the MH will go in a drawer for now.
I think you should give it another chance. Without your whole setup I cannot do more than I did. I did solder a wire antenna while testing, then removed it.
Everything worked as expected, so ... I really don't know why it doesn't work for you.
Getting to know the code a little better and how the different components interact will definitely help with finding the issue, if any.
The mightyHat you sent is soldered correctly, it worked with a Pi V2 I had, so no issue with the hardware.