Joshua
Junior Member
Posts: 75
|
Post by Joshua on Sept 23, 2018 16:55:58 GMT
I have found that switching either RELAY2 or RELAY3 while CURSEN is enabled will cause a crash/collision in the gateway
The issue only happens when trying to switch either relay on or off.
Here's the configuration
#define RELAY2 // control a load 2. Brump added. #define RELAY3 // control a load 3. Brump added.
#define CURSEN // Monitoring the AC current on all loads. Brump added.
And here's the MQTT messages received from the gateway
9/23/2018, 11:46:03 AMnode: 128f4f9e.e2bba8home/rfm_gw/nb/node71/dev90 : msg : Object { topic: "home/rfm_gw/nb/node71/dev90", payload: "radio lost node 71", qos: 0, retain: false, _topic: "home/rfm_gw/nb/node71/dev90" … }
9/23/2018, 11:46:03 AMnode: 346c2912.72e116 home/rfm_gw/nb/node71/dev90 : msg.payload : string[18] "radio lost node 71"
The ON/OFF command rarely makes it to the node as I monitor the debug output.
I've tested this on both a Pro Mini and an Uno. RELAY2 and RELAY3 work just fine without CURSEN enabled as well as CURSEN will only work as long one does not change the state RELAY2 or RELAY3.
|
|
|
Post by papa on Sept 24, 2018 16:05:30 GMT
Joshua, I have not tried RELAY2 or RELAY3 with CURSEN. I wonder if the issue could be caused by a current shortage. When a node uses too much current, the microprocessor or RFM69 radio may reset. I've had this issue sometimes with using relays with sensors. Instead of using an Arduino pin to power the relay directly, I've used the Arduino pin to cause a transistor to supply Arduino 5 volts to the relay (See schematic below). That's worked well for me.
^^ Forum members (free registration), click on pic for larger view.
|
|
Joshua
Junior Member
Posts: 75
|
Post by Joshua on Sept 24, 2018 16:42:02 GMT
I don't think its a current shortage. The problem exists without anything but the radio plugged into the node.
papa: Thanks for that clarification. We'll wait for brump to address this.
|
|
Joshua
Junior Member
Posts: 75
|
Post by Joshua on Oct 9, 2018 14:19:56 GMT
Here's a video of what is going on.
- The gateway node is on COM5 (RFM_MQTT_GW_25.1_pub1)
- There is a window with the MQTT Broker set to sub to a wildcard
- The CURSEN and Relays are on the Arduino IDE windows
You can see that the relays function just fine with CURSEN disabled and the gateway is not publishing correctly when CURSEN is enabled.
|
|
|
Post by papa on Oct 11, 2018 18:07:24 GMT
I scanned the multi choice node code looking for errors related to CURSEN. Earlier in the code, I saw that for CURSEN, I changed brump's device 52 (same as Joshua's current sensor) to device 53. But later in the main loop, I found that I did not consistently change those device numbers. In this post, get the Latest Node Choices Sketch & Initial Customization.
In this version ^^ , I corrected those device numbers. This version includes Joshua's LED Strip Driver node. Joshua, please try this version & see if this avoids the RELAY2 or RELAY3 collision with CURSEN. If these changes do not help, we'll probably have to wait for brump's input (& he may be out to sea with not the best internet connection until back home)
|
|
Joshua
Junior Member
Posts: 75
|
Post by Joshua on Oct 14, 2018 21:18:45 GMT
The problem still exists :/ Can't run the new script with both, RELAYS and CURSEN, enabled.
|
|
brump
Junior Member
Posts: 81
Member is Online
|
Post by brump on Oct 21, 2018 13:06:27 GMT
The problem still exists :/ Can't run the new script with both, RELAYS and CURSEN, enabled. Hello, Papa and Joshua, Sorry for my absence. Unfortunately I continue in a long period at sea, I will try to see what happens with the code in relation to CURSEN. For CURSEN, I use an external library and did not analyze how the code behaves in relation to Hardware.
|
|
brump
Junior Member
Posts: 81
Member is Online
|
Post by brump on Nov 16, 2018 20:04:01 GMT
Hello Joshua and Papa, A friend boarded my arduino boards. I found some bugs in the code. And I made some errors that went unnoticed, probably already corrected by PAPA. The reading of the current varies constantly, so I believe it overloads the Gateway buffer. I removed the current reading from the loop and inserted the call to the cursensor.getCurrentAC (60) function; (The number 60 refers to the frequency of 60Hz) in the block of periodic transmissions. Enabled the flags SW2, SW3, SW4, RELAY1, RELAY2, RELAY3, RELAY4, DIM1, DIM2, POTCF, POTDIM, CURSEN. All code is working perfectly. Below is the attachment. This is a much older version of computourist_node_v2.2MgI_choices_pub, the Papa already has a much newer version. I would like you to test on your node and report me if there was success.
PS: Sorry for the delay in answering it, but I had to have the hardware in hand to be able to perform the tests. To make the boat's firewall worse, it categorized proboards as social network content and carried out the blockade. It was a struggle to create a VPN network with the precarious connection I have here.
|
|
|
Post by papa on Nov 17, 2018 15:14:03 GMT
Thanks, brump, for looking at this issue, given your challenging situation.
joshua, please test the sketch that brump provided in the above post & confirm that the changes work. When you confirm they work, I'll make the changes in the latest version of the multi-choice sketch.
|
|
Joshua
Junior Member
Posts: 75
|
Post by Joshua on Nov 19, 2018 13:17:08 GMT
I'll be able to to next week. I'm off visiting family this week.
|
|
|
Post by papa on Nov 19, 2018 15:15:07 GMT
Thanks, Joshua, good to hear from you. I appreciate your testing the revised code.
I'm experimenting with a different structure for the multi-choice node sketch.
So confirming that RELAY2 & RELAY3 code are working with CURSEN now would be helpful to know fairly soon.
|
|
Joshua
Junior Member
Posts: 75
|
Post by Joshua on Nov 26, 2018 16:07:07 GMT
Gents,
This is a confirmation that the update has resolved the issue at least for RELAY2/3 used with CURSEN. I'll update my build out post with how I apply this node to my 3d printer.
|
|
|
Post by papa on Nov 26, 2018 19:57:51 GMT
Thanks, Joshua, for confirming a fix of the conflict between RELAY2/3 & CURSEN. We'll look forward to your update on using this fix.
I'll merge the fixes / updates into the Node Choices sketch.
|
|
|
Post by papa on Nov 27, 2018 21:25:24 GMT
Node Choices Sketch with Brump's Updates ??
a Node Choices sketch that merges in brump's updates/fixes for SWT1-4, RELAY1-4 & CURSEN. brump & joshua, please check that this sketch works, especially for options RELAY1-4 & CURSEN. I've scanned the revised sketch brump posted above & I believed I have merged all changes into the latest Node Choices sketch. Note: Where brump used device 52, I have used device 53.
|
|
brump
Junior Member
Posts: 81
Member is Online
|
Post by brump on Dec 3, 2018 15:49:02 GMT
Gents,
This is a confirmation that the update has resolved the issue at least for RELAY2/3 used with CURSEN. I'll update my build out post with how I apply this node to my 3d printer.
Thanks for the confirmation. Good luck with building your new node.
|
|