Author Topic: switchmote sketch  (Read 1385 times)

Kilo95

  • Sr. Member
  • ****
  • Posts: 340
  • Country: us
switchmote sketch
« on: July 29, 2019, 02:10:38 PM »
Just got my 16A Switchmote put together. When I was looking at the sketch, I don't see a spot for the encrypt key, node ID, etc. On the Switchmote pages, I see it says it's setup for standalone. I'd like mine to connect to my gateway so I can control my device remotely like I can my other stuff. Does anyone have a Switchmote sketch for this? Thanks

sparky

  • Sr. Member
  • ****
  • Posts: 296
  • Country: us
Re: switchmote sketch
« Reply #1 on: July 29, 2019, 04:00:07 PM »
That info isn't entered into the sketch.. that info is setup in the EEPROM using putty.. the guide explains all this

Kilo95

  • Sr. Member
  • ****
  • Posts: 340
  • Country: us
Re: switchmote sketch
« Reply #2 on: July 29, 2019, 07:05:44 PM »
My apologies. I missed that. With two little kiddos running around, that’s no surprise. Are the BTN and SW setting preset or do I need to program them? If so, what do I need to set them to? I’ll have the SwitchMote connected to an outlet. I just want to be able to turn it on/off remotely. Also, how do I connect to the moteino via putty? I know how to program with arduino ide. Thanks for the help

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6867
  • Country: us
    • LowPowerLab
Re: switchmote sketch
« Reply #3 on: July 29, 2019, 07:38:40 PM »
BTN and SW?  ??? Not sure what you mean.

As soon as you press a button, if all is right (radio settings), it will show in the Gateway UI, as a new node where you can select the type and so on, then the buttons will show as you press them.
You connect the Moteino controlling the SwitchMote like any other Moteino - through a USB/serial adapter like the FTDIAdapter. It can be plugged into the SwitchMote (but not to MAINS!).

Kilo95

  • Sr. Member
  • ****
  • Posts: 340
  • Country: us
Re: switchmote sketch
« Reply #4 on: July 29, 2019, 07:40:24 PM »
felix, the radio settings aren't in the sketch. the other person was telling me i have to use putty to set that up. i'm not quite understanding how to connect via putty

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6867
  • Country: us
    • LowPowerLab
Re: switchmote sketch
« Reply #5 on: July 29, 2019, 07:43:49 PM »
You need putty because the Arduino serial monitor is sadly deficient.
Did you actually look at the guide? It's ... literally all there. I promise.

Kilo95

  • Sr. Member
  • ****
  • Posts: 340
  • Country: us
Re: switchmote sketch
« Reply #6 on: July 29, 2019, 08:20:52 PM »
I did. I wasn’t seeing how to connect via putty. I’ll look again

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6867
  • Country: us
    • LowPowerLab
Re: switchmote sketch
« Reply #7 on: July 29, 2019, 08:23:27 PM »
I would read that page carefully again. There are photos, showing how to physically connect. The descriptions describe why use Putty and not the IDE's serial monitor.
Putty is a general purpose terminal, includes ability to open serial ports.

Kilo95

  • Sr. Member
  • ****
  • Posts: 340
  • Country: us
Re: switchmote sketch
« Reply #8 on: July 30, 2019, 09:34:51 AM »
I was making it more difficult than it was. Putty kept freezing up when I would connect and wouldn't let me enter anything. I tried two versions of Putty and two different USB cables to connect the FTDI. I never figured out what the problem was but once out of every 5-6 attempts, Putty didn't freeze up so I was able to get the EEPROM situated and it connected to my PiGateway. I do still have one question. How do I associate the relay with a particular button (B0) or is that automatic? It's a single 16A relay
« Last Edit: July 31, 2019, 08:50:47 AM by Kilo95 »

Kilo95

  • Sr. Member
  • ****
  • Posts: 340
  • Country: us
Re: switchmote sketch
« Reply #9 on: August 01, 2019, 06:28:06 PM »
I got the eeprom set. Everything lights up, leds change to green when buttons are pressed. Shows up in gateway but when a button is pressed, the relay isn’t working. I’ve checked with a DVM at the blue terminal and it isn’t switching. Any ideas?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6867
  • Country: us
    • LowPowerLab
Re: switchmote sketch
« Reply #10 on: August 02, 2019, 09:41:58 AM »
The pins on SwitchMote P3 are: Relay1 = D7, Relay2 = D3.
Look at the circuit on the board. Any parts damaged/dislodged?
Relay soldered well to the board?

Kilo95

  • Sr. Member
  • ****
  • Posts: 340
  • Country: us
Re: switchmote sketch
« Reply #11 on: August 02, 2019, 11:52:32 AM »
I think I’m going to have to get a desoldering gun to get the button board off so I can get in there and check the relay pins and their solder. Would that be something I could send back to you to check and if so, what would that cost me?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6867
  • Country: us
    • LowPowerLab
Re: switchmote sketch
« Reply #12 on: August 02, 2019, 12:25:00 PM »
Just take the button cover off the SwitchMote Shield PCB. You'll notice there are HOLES in the SwitchMote Shield where you can probe with your DMM for continuity. You can check the relays there, both on the DC side and AC side. Perhaps even possible to desolder through there if you have a thin enough iron tip. But the holes are there for this very purpose to allow probing after the 2 PCBs are mated.