www.homeseer.com    
 

Go Back   HomeSeer Message Board > Analog & Digital IO Device Plug-ins > Analog & Digital IO Discussion > Arduino Plugin (3P)

Arduino Plugin (3P) Discussions related to the Arduion plugin for HS3 by enigmatheatre

Reply
 
Thread Tools Display Modes
  #1  
Old May 29th, 2018, 05:34 AM
santoal santoal is offline
Seer
 
Join Date: May 2018
Location: Western Australia
Posts: 14
Com Port Auto Connect Issues

Hi

Relatively new to Homeseer and the Audrino plug-in. Thanks to this forum I've solved 9 of my 10 issues through research. Fantastic system having used Vera before.

However stumped with fixing this.

Requirement:
- Have Audrino auto re-connect when either USB connection lost or PC reboots
- Need to have system operating close to 24/7 without intervention (WAF)

Observations:
1) Pulling USB plug out, Audrino plug-in still shows "Connected" with "Warning = Com Port No:4 is not open"
2) Putting USB back in, plug-in does not restore connections, despite showing "connected"
3) Manually disconnecting and connecting sometimes work, but often get "Error = Exception in Connect : Access to the port 'COM4' is denied"
4) Unchecking and checking "Auto Connect" sometimes works
5) With PC restart, connection re-established automatically 80% of the time
6) Manually killing the service "HSPI_Arduino (32)" (Arduino IDE) seems to unlock access to the com port and everything works fine again

Setup:
- Arduino Mega 2560
- Arduino Plugin V1.0.0.147
- Arduino IDE 1.8.1

Debug file attached.

Any help or advice to a novice appreciated.

Thanks!
Attached Files
File Type: txt ArduinoDebug.txt (272.9 KB, 1 views)
Reply With Quote
  #2  
Old May 29th, 2018, 08:33 PM
petez69's Avatar
petez69 petez69 is offline
Seer Master
 
Join Date: Oct 2005
Location: Alice Springs, Australia
Posts: 882
From personal experience, move to Ethernet based connection.....I had found previously during testing rapid relay output changes, some would get lost....it never got lost when i moved to ethernet.

Pete
Reply With Quote
  #3  
Old May 29th, 2018, 09:22 PM
santoal santoal is offline
Seer
 
Join Date: May 2018
Location: Western Australia
Posts: 14
Thanks Pete.

I had tried the Ethernet shield. I got it working but still found reconnection issues. Thought it would just be as easy to troubleshoot usb! I reverted back to usb because I wanted a simpler setup, but most because server is right near the board so connection is easy, and I lost 5 pins which meant a whole lot of reconfig.
I’m saving the Ethernet shield for another board which will be put in a remote location without USB. Thanks
Reply With Quote
  #4  
Old June 3rd, 2018, 04:28 AM
santoal santoal is offline
Seer
 
Join Date: May 2018
Location: Western Australia
Posts: 14
Ethernet shield Auto connect issues

Ok - I've connected an ethernet shield which solved an issue with the LCD not displaying as described in this thread:

https://forums.homeseer.com/showthre...00#post1368600

I do still have a problem with re-connection issues however with the shield.

The problem occurs when I lose IP connection (either I unplug the ethernet cable or the server reboots with uninterrupted power to the board). I get "Error = Board: 1 Connection FAILED". Hitting "Connect" or "Reset" makes no difference.

Once I cycle the power to the Board, a get a successful Auto connection within about 2 seconds. It's a problem as my server reboots weekly and I'd like it to automatically reconnect.

I have attached my log file.

Appreciate any suggestions on how I can fix.
Attached Files
File Type: txt ArduinoDebug.txt (183.4 KB, 1 views)
Reply With Quote
  #5  
Old June 5th, 2018, 07:00 PM
jasonr2231's Avatar
jasonr2231 jasonr2231 is offline
Seer
 
Join Date: Dec 2002
Location: Michigan
Posts: 44
Can not connect

I can not seem to get the board to connect or stay connected. Yesterday it would connect but fail after a few minutes (before I could even add any pins). Today I can't even get it to connect. I have read through the instructions several times and think I have done each step. I can connect with the Arduino software as I can see the board config has changed. I'm a bit out of my league so any help would be greatly appreciated. I have attached tke .ino debug file.
Attached Files
File Type: txt ArduinoDebug (1).txt (5.0 KB, 4 views)
Reply With Quote
  #6  
Old June 5th, 2018, 07:28 PM
jasonr2231's Avatar
jasonr2231 jasonr2231 is offline
Seer
 
Join Date: Dec 2002
Location: Michigan
Posts: 44
Can not connect

Digging further to see if it's a COM port issue, I find the following error.

The application-specific permission settings do not grant Local Launch permission for the COM Server application with CLSID Windows.SecurityCenter.WscDataProtection and APPID
Unavailable to the user NT AUTHORITY\SYSTEM SID (S-1-5-18) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool.

again...waaaay out of my league but maybe there is a nugget that some would find useful. I think have had other COM port issues with in ability to COM 1 once in a while. HS even replaced S6 but problem still existed.....assumed it was Napco Gemini or GTS CPUXA issue.
Reply With Quote
  #7  
Old June 6th, 2018, 12:43 AM
santoal santoal is offline
Seer
 
Join Date: May 2018
Location: Western Australia
Posts: 14
I assume you can connect and download the sketch over the same com port using the Arduino IDE?
Reply With Quote
  #8  
Old June 6th, 2018, 06:05 AM
enigmatheatre's Avatar
enigmatheatre enigmatheatre is offline
Super Seer
 
Join Date: Oct 2009
Location: Aberdeen Scotland UK
Posts: 1,822
Looking at the debug the board is not connected on the comport. have you uploaded the sketch from the config page with the IDE? can you post this sketch so I can check it is correct?

Greig.
__________________
Zwave = Z-Stick, 3xHSM100™ 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
Scripts =
Various
Reply With Quote
  #9  
Old June 6th, 2018, 06:44 AM
jasonr2231's Avatar
jasonr2231 jasonr2231 is offline
Seer
 
Join Date: Dec 2002
Location: Michigan
Posts: 44
Can not connect

Yes I have. I think I had the wrong IDE version when the original sketch was downloaded, modified and uploaded. I have 1.8.1 (was 1.6.?) maybe I need to start over. How would I get back to a basic sketch (or the one that came on the board)?
Attached Files
File Type: txt Sketch.txt (25.9 KB, 1 views)
Reply With Quote
  #10  
Old June 6th, 2018, 07:56 AM
enigmatheatre's Avatar
enigmatheatre enigmatheatre is offline
Super Seer
 
Join Date: Oct 2009
Location: Aberdeen Scotland UK
Posts: 1,822
The sketch you just attached is set for Ethernet connection so will not work.

Do the following.

1.Set up the board comport on the config page
2. Select the board number from the dropdown list at the top of the page then click to download the sketch.
3. Open this sketch in the IDE ensuring you have the same version as stated on the plugin config page.
4.Select your board type and comport.
5.Click to compile and download the sketch to the board.
6.Close the IDE and then connect to the board in homeseer.
7. Set up the pins you require.
8. Wire it all up and have fun.

You never need to modify the sketch as the plugin will do this for you.
The only time you need a new sketch is when there is an update or you change the connection from Com to Ethernet or back again.

I hope this helps.

Greig.

Sent from my SM-G950F using Tapatalk
Reply With Quote
  #11  
Old June 6th, 2018, 08:10 PM
jasonr2231's Avatar
jasonr2231 jasonr2231 is offline
Seer
 
Join Date: Dec 2002
Location: Michigan
Posts: 44
Can not connect

Sweet. Thanks. I was missing setting up the board BEFORE downloading. I thought I did that in the IDE first. Working now.
Reply With Quote
  #12  
Old June 6th, 2018, 09:05 PM
santoal santoal is offline
Seer
 
Join Date: May 2018
Location: Western Australia
Posts: 14
Hi Greig

I was wondering if you could help with my open issue with the ethernet shield connection issue I have (as stated above).

Is it normal that I have to cycle the power on the board to re-establish an IP connection once it drops out?

Thanks
Reply With Quote
  #13  
Old June 8th, 2018, 09:00 AM
enigmatheatre's Avatar
enigmatheatre enigmatheatre is offline
Super Seer
 
Join Date: Oct 2009
Location: Aberdeen Scotland UK
Posts: 1,822
Quote:
Originally Posted by santoal View Post
Hi Greig

I was wondering if you could help with my open issue with the ethernet shield connection issue I have (as stated above).

Is it normal that I have to cycle the power on the board to re-establish an IP connection once it drops out?

Thanks
No this is not normal. I did have problems with this but it turned out to be a power drain on the board from external devices on startup causing the board to crash. Can I ask what you are powering the board with and what devices you have connected to the outputs?

Greig.
Reply With Quote
  #14  
Old June 8th, 2018, 09:01 AM
enigmatheatre's Avatar
enigmatheatre enigmatheatre is offline
Super Seer
 
Join Date: Oct 2009
Location: Aberdeen Scotland UK
Posts: 1,822
Quote:
Originally Posted by jasonr2231 View Post
Sweet. Thanks. I was missing setting up the board BEFORE downloading. I thought I did that in the IDE first. Working now.
Good news. Have Fun.

Greig.
Reply With Quote
  #15  
Old June 9th, 2018, 10:27 PM
santoal santoal is offline
Seer
 
Join Date: May 2018
Location: Western Australia
Posts: 14
Quote:
Originally Posted by enigmatheatre View Post
No this is not normal. I did have problems with this but it turned out to be a power drain on the board from external devices on startup causing the board to crash. Can I ask what you are powering the board with and what devices you have connected to the outputs?

Greig.
Thanks Greig. I'm glad to hear it's not normal... so something is causing the issue.

The board is currently being powered by a 7.2V DC power supply as I found a 5V power supply wasn't enough to power the LCD (its drops to 3.4V on the 5V terminals on the board).

In testing, I've also tried 12V (but gets a little hot as per other posts), USB and POE+ via my Unifi 24 port switch. I currently have the POE disconnected. I find that turning off and on the 7.2V power results in a re-connection with the no POE connection. If I remove the 7.2V and use the POE, then the board still fails to reconnect. Again, if I cycle the POE power from the unifi controller, it will also reconnect.

I currently have the following devices connected:
- 16x2 LCD with I2C
- 8 channel relay board (with only 1 device connected)
- Genuine ethernet V2 shield

The devices connected are to and from 12 V relays for door locks and reed switches (dry contacts). I still had the issue when I disconnected the devices.

Here is the message on the plug-in console when I unplug the ethernet cable:
Warning = Board: 1 has a connection ERROR. Retrying.
Warning = Board: 1 has a connection ERROR. Trying Reset.
Error = Board: 1 Connection FAILED.
[PLUG ETHERNET CABLE BACK IN - NO RECONNECTION]
[MANUAL CONNECTION ATTEMPT]

Connecting Board No:1 at ip address 192.168.1.65 Port No:8900
[NO RESPONSE - PWR CYCLE HERE]
Com port lost
Connecting Board No:1 at ip address 192.168.1.65 Port No:8900
Board 1 Version 1.0.0.145 and Plugin Version 1.0.0.147 are compatible.
Connected to Board No:1 at ip address 192.168.1.65 Port No:8900
Updating pins on Board No: 1
Updating Values on Board No: 1
[RECONNECTED]


I can also ping the board when the ethernet cable is reconnected.

Thoughts?
Reply With Quote
  #16  
Old June 10th, 2018, 09:04 AM
enigmatheatre's Avatar
enigmatheatre enigmatheatre is offline
Super Seer
 
Join Date: Oct 2009
Location: Aberdeen Scotland UK
Posts: 1,822
Quote:
Originally Posted by santoal View Post
Thanks Greig. I'm glad to hear it's not normal... so something is causing the issue.

The board is currently being powered by a 7.2V DC power supply as I found a 5V power supply wasn't enough to power the LCD (its drops to 3.4V on the 5V terminals on the board).

In testing, I've also tried 12V (but gets a little hot as per other posts), USB and POE+ via my Unifi 24 port switch. I currently have the POE disconnected. I find that turning off and on the 7.2V power results in a re-connection with the no POE connection. If I remove the 7.2V and use the POE, then the board still fails to reconnect. Again, if I cycle the POE power from the unifi controller, it will also reconnect.

I currently have the following devices connected:
- 16x2 LCD with I2C
- 8 channel relay board (with only 1 device connected)
- Genuine ethernet V2 shield

The devices connected are to and from 12 V relays for door locks and reed switches (dry contacts). I still had the issue when I disconnected the devices.

Here is the message on the plug-in console when I unplug the ethernet cable:
Warning = Board: 1 has a connection ERROR. Retrying.
Warning = Board: 1 has a connection ERROR. Trying Reset.
Error = Board: 1 Connection FAILED.
[PLUG ETHERNET CABLE BACK IN - NO RECONNECTION]
[MANUAL CONNECTION ATTEMPT]

Connecting Board No:1 at ip address 192.168.1.65 Port No:8900
[NO RESPONSE - PWR CYCLE HERE]
Com port lost
Connecting Board No:1 at ip address 192.168.1.65 Port No:8900
Board 1 Version 1.0.0.145 and Plugin Version 1.0.0.147 are compatible.
Connected to Board No:1 at ip address 192.168.1.65 Port No:8900
Updating pins on Board No: 1
Updating Values on Board No: 1
[RECONNECTED]


I can also ping the board when the ethernet cable is reconnected.

Thoughts?
I can not think of a reason for this to happen other than it being a problem with the V2 shield as I only have V1.
I see there is a Comport that is lost when you hard reset the board, running the board on USB as well as the psu. Try removing the USB.

My server can reset without problems and I know others do this to as there was a time when I had to change the code so the board would reconnect.

How long are you leaving the board after the disconnect as there is a reset timer in there that should restart the board if this times out? Try leaving it longer as I think it is about 3 or 4 min.

You have a LCD on the board what is it saying as there should be status messages on it. Leave the board until it has displayed the board reset.

Greig.
Reply With Quote
  #17  
Old June 10th, 2018, 09:49 PM
santoal santoal is offline
Seer
 
Join Date: May 2018
Location: Western Australia
Posts: 14
Thanks Greig.

No difference with USB disconnected... I even disabled all other COM ports and no change.

I'm leaving the board disconnected from ethernet until I get the "!CONNECTION Failed" message on the plug-in console. I then plug the ethernet cable back in and nothing happens. I've left it for over 30 minutes with cable plugged back in. The LCD display just shows "Connection Err" - I'm guessing it should show "Connection Error" and "or" is cut off with 16 character display. I don't see "Reset" come up on the LCD either before or after I plug the ethernet cable back in.

I note that I have to hit "connect" after the power cycle to re-initiate the connection. So I'm guessing it's not detecting the board connection is re-established.
Reply With Quote
  #18  
Old June 19th, 2018, 06:28 AM
santoal santoal is offline
Seer
 
Join Date: May 2018
Location: Western Australia
Posts: 14
After lots of troubleshooting, I haven't been able to fix this issue. I do have a work around that may benefit others however

Solution:
1) Power Arduino board using PSU (POE disabled and USB disconnected)
2) Plug PSU in to a z-wave switch and set-up in HS3 using z-wave plug-in
3) Setup event to monitor state of Arduino board connection. When board becomes disconnected or connection fails, cycle the power to the PSU using z-wave switch and re-initiate a connection

I have setup a number of events and a counter so that the board attempts to re-connect every minute for 10 minutes. A virtual device "Arduino Auto Connect" enables me to turn off the power cycling after 10 attempts and manually disable if needed.
Attached Images
 
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Arduino auto-connect on startup monument Arduino Plugin (3P) 4 July 10th, 2017 09:10 AM
Can I auto connect to plugin on restart concordseer Concord 4 Security Panel Plug-in (3P) 2 March 16th, 2017 11:47 AM
24 port switch and not connect to each other? TeleFragger Personal Computers 10 May 31st, 2016 11:56 AM
HS will not connect with SG Com Port 2 anymore TCIII JDS (Stargate, TimeCommander) 0 March 5th, 2007 11:51 PM


All times are GMT -4. The time now is 12:37 AM.


Copyright HomeSeer Technologies, LLC