Com fails after 5mn of work

Discussion and support for the Nmea4Wifi multiplexer - a 4-input Nmea 0183 wifi multiplexer.
Post Reply
EricP56
Posts: 5
Joined: Fri Dec 23, 2022 3:35 pm

Com fails after 5mn of work

Post by EricP56 » Fri Dec 23, 2022 9:40 pm

Good evening, my NMEA4WIFI is connected on P5 to a RPI3 with OpenCPN, and to P1 to an AIS watchmate 850 tranceiver.
It's installed since last spring and worked perfectly until a few weeks, because now I only get my GPS position and the AIS targets on opencpn the few first mn after switch on (kind of).
The green led P1 flashes from time to time, and sometime the red led P5 also.
If I bypass nmea4wifi, connecting the RPI directly to the AIS tranceiver, it works perfectly.
If I change P1 to P2, the problem's still the same.
If I connect a PC to the NMEA4WIFI with the wifi, and set the NMEA4WIFI in debug, I can see that when it fails I get some strange data incoming on P1 (not nmea sentences for sure).
If I exchange the 2 opto couplers A263N on the mux, no led flashes anymore.
Do you think I should try to buy new A263N and change them ? Do you think it could come from elsewhere ?
thanks for your answer.
Eric

Luis Sa
Site Admin
Posts: 843
Joined: Thu May 04, 2017 4:12 am

Re: Com fails after 5mn of work

Post by Luis Sa » Fri Dec 23, 2022 11:32 pm

Hello Eric,

Sorry to hear about that. As per your post I understand that you have a TH version. I am not sure about the firmware. You say after 5 minutes - is it exactly 5 minutes (after power on or a new setting) or it is about. Actually 5 minutes after starting the multiplexer checks if there it can switch off WiFi (to spare power). For example if both TCP and UDP ports are zero. Or even if the ports are different from zero, if no WiFi output or input is set. If these conditions are true, the multiplexer switches off WiFi but it maintains serial routing (in your case reading P1 and outputting on P5). So please confirm it is EXACTLY 300 seconds or 5 minutes.

You say that exchanging the optocouplers the multiplexer works differently. There is an hardware test described here:

https://www.vela-navega.com/forum/viewt ... ideo#p1042

It would be useful if you test it. Only if the test fails, new optocouplers would be needed. When I started to use the AN263N I was using the input resistance as 1K5. Later I found that 1K was better. Please do the test and report. If the problem is the optocouplers do not worry as I can send you replacements. Could you also tell me if have experience with soldering irons? Just in case a small modifications is needed and to avoid returning the multiplexer back to me.

Regards, Luis

EricP56
Posts: 5
Joined: Fri Dec 23, 2022 3:35 pm

Re: Com fails after 5mn of work

Post by EricP56 » Sat Dec 24, 2022 1:33 pm

Hi Luis, thank you for your answer.
Yes it is a TH version, I don't have its firmware version but I could get it next time I go to the boat.
When I said 5mn, it's about. It's sometimes less, sometimes more. For exemple yesterday when I made my first try it worked between 5 and 10mn, then I saw decreasing regularity on p1 led, and even more irregularity on p5 led, meaning all the sentences from p1 weren't transmitted on p5. After subsequent on/off, it was less than 5mn.

I will do the test you describe next week. I've ordered HCPL2731 optocouplers as described on your circuit diagram, do you think I could use them in place of the actual an263n ?

I don't understand the 1.5k or 1k resistors you talk about, in your diagram input resistance on Px seems to be 2.2k ?

No problem for soldering if necessary

Regards, Eric

Luis Sa
Site Admin
Posts: 843
Joined: Thu May 04, 2017 4:12 am

Re: Com fails after 5mn of work

Post by Luis Sa » Sat Dec 24, 2022 5:50 pm

Hello Eric,

Please don't use the 2731. I can send you 263N. They are much faster.

If you check the schematics in the bottom of this page

https://www.vela-navega.com/forum/viewt ... t=209#p912

you see R1 as 1K. It is as 8 pin resistor array consisting in 4 isolated 1K resistors. I used 1K5 in the 1st units. They worked as I test one by one, but I found better waveforms with 1K. It is just one idea. I wait for you to do the hardware test. When you go to the boat take photos of the PCB so that I clearly identify your unit.

Best Regards, Luis

EricP56
Posts: 5
Joined: Fri Dec 23, 2022 3:35 pm

Re: Com fails after 5mn of work

Post by EricP56 » Tue Dec 27, 2022 8:53 pm

Hello Luis
I went to the boat today : the hardware test you told me is successfull on each input P1 to P4, meaning the green led flashes 5 times then the red one strobes a gust, etc...
I reconnected the NMEA4WIFI directly, it started to run normally (led green then red to tx p5, and the RPI got the position), but after maybe 30s, before I could reconnect my phone to the mux the problem reappeared. I join you a screenshot of the nmea4wif debug page from my smartphone, taken at that moment.
Then I tried once again to bypass the multiplexer, connecting my AIS Tranceiver directly to the RPI (through a rs485 converter), and Opencpn got the right position without any interruption.
Attachments
IMG_20221227_183036620_HDR.jpg
Screenshot_20221227-185727.png
IMG_20221227_184352256_HDR.jpg

EricP56
Posts: 5
Joined: Fri Dec 23, 2022 3:35 pm

Re: Com fails after 5mn of work

Post by EricP56 » Fri Jan 06, 2023 1:00 pm

Hello Luis,
Happy new year, best wishes for 2023.
Regarding my answer from the 27th of december, what do you think should be the next step ? changing the 263N ? changing the resistor array ?
Thank you for your answer
Regards
Eric
Luis Sa wrote:
Sat Dec 24, 2022 5:50 pm
Hello Eric,

Please don't use the 2731. I can send you 263N. They are much faster.

If you check the schematics in the bottom of this page

https://www.vela-navega.com/forum/viewt ... t=209#p912

you see R1 as 1K. It is as 8 pin resistor array consisting in 4 isolated 1K resistors. I used 1K5 in the 1st units. They worked as I test one by one, but I found better waveforms with 1K. It is just one idea. I wait for you to do the hardware test. When you go to the boat take photos of the PCB so that I clearly identify your unit.

Best Regards, Luis

Luis Sa
Site Admin
Posts: 843
Joined: Thu May 04, 2017 4:12 am

Re: Com fails after 5mn of work

Post by Luis Sa » Fri Jan 06, 2023 2:08 pm

Hello,

Please send me your address by private email and I will send you the faster optocouplers. I can also send you a replacement unit if you want to return the one with you. At the moment SMD version is out of stock. I expect to have them again in 2 weeks unless covid gets worst in China. TH version is available. I look forward to your email.

Regards, Luis

PS - note that I never had a report like the one you describe. So I am not sure if the problem is the optocoupler. As you can imagine I do the hardware test on every TH or SMD version but I do not left the multiplexer working for 5 minutes. So I am not sure what is the cause of that behavior. The best is to send the optocouplers. If the problem maintains we replace the unit.

EricP56
Posts: 5
Joined: Fri Dec 23, 2022 3:35 pm

Re: Com fails after 5mn of work

Post by EricP56 » Sun Jan 08, 2023 9:17 pm

Hi Luis, I've sent you my postal address by private email.
Best regards
Eric

Luis Sa
Site Admin
Posts: 843
Joined: Thu May 04, 2017 4:12 am

Re: Com fails after 5mn of work

Post by Luis Sa » Fri Jan 27, 2023 2:26 am

Hello,

This is a response to Eric and to other users that can have this problem.

(I sent 2 A263N optocouplers and a ESP32 module to Eric. Eric tested the 2 new optocouplers and the new ESP32 module and told me that the problem remained. I asked him to perform the hardware test. He made the hardware test and said it was OK. So I decided to send him a new TH unit. He sent me back his unit plus the 2 optocouplers and the ESP32 module. I receive these pieces today. In this post I report my tests on the returned unit. Eric will probably have the same problems with the unit that is going to him)

As soon as I received the unit that Eric returned to me I tested it. All tests were good. Then I read more carefully Eric's description of the problem. Data comes from an AIS transponder, enters on port P1 (or P2) at 38400 and goes out on port P5 to a RPI running OpenCPN. I forgot to ask Eric to run Simulation Mode but I am 99% sure that if he runs the Simulation Mode he will get good results on OpenCPN. Returning to Eric's description of the problem, he refers that the green light that blinks sparsely and that Debug Mode shows bad sentences. That means that the problem is in the link "AIS > Multiplexer" and not on the "Multiplexer > RPI" link. I confirmed that his unit had the 1K input resistors. So I started to suspect that his AIS does not drives the multiplexer with a strong enough signal. The multiplexer output is based on the MAX485 integrated circuit which outputs a wave varying between 0 and +5 volts. In the hardware test, the output of the MAX485 goes to the inputs. So when the driving signal varies between 0 (idle state) and +5V the multiplexer works OK. In the notes that follow I refer to an input resistor R1 that has the value of 1K and if reduced to 500R would probably solve the problem that Eric has found. This resistor R1 corresponds to R2 shown in this picture. Remember that the NMEA4WIFI multiplexer has 4 input ports. So it has 4 input resistors, 4 single channel optocouplers (2x A263N suffice as they are dual channel optocouplers) and so on. Actually R1 is the label for a resistor network that has 4 independent resistors available in 8 pins as depicted in the following picture.

Image7.jpg

I have in my lab a USB to TTL driver that outputs a waveform varying between 0 and 3.3 volts. With the Nmea0183Tester tool I outputted a TXT file (containing nmea0183 sentences) to port P1 of the returned unit. And it failed. If you are reading this response it could be useful to have the A263N datasheet. We see that the input voltage across the input diode, VF (see page 6) has a minimum value of 1V, a typical value of 1.3V and a maximum value of 1.6V. Lets us assume that the present A263N units have VF=1.3V. So, when a pulse voltage of 3.3V is applied to the input of the multiplexer, 1.3V appears across the input diode and the remaining 2V across the input 1K resistor. So the input current on the optocoupler is 2V/1K = 2mA. This normally works but is small. In the Selection Guide of page 2 of the datasheet we see the the Input-On Current is 3mA. If the driving waveform reaches +5V then 3.7V appear across the 1K resistor which means that the Input-ON current is 3.7mA.

We should note that 3mA is the guaranteed value of the Input-ON current to drive the output of the optocoupler from HIGH to LOW. The typical value is 1.5mA. And this value depends on the resistor load, RL, which also is 1K. If we look to figure 7 we see that the typical value for RL = 1K is 1.2mA. And in figure 10 we see that this typical value rises with temperature. So as the temperature rises (and when we switch ON the multiplexer the device temperature rises above the ambient temperature) we need more Input-ON current to switch the optocoupler output. That is an explanation for Eric observation that the multiplexer works OK for 1 or 2 minutes and then does not work as expected.

A side note - with the SMD multiplexer and the referred to 0V to 3.3V driver this problem does not show.

If we used an input resistor of say 500R (note that when I started to use the fast A263N optocouplers I used an input resistor of 1.5K) we will have more current. Repeating the above calculations with an input voltage of 3.3, the 2V across the input resistor of 500R will yield an Input-ON current of 4mA which is clearly greater than 3mA (the worst case in terms of needed current). I just tested this case and it is running without problems for about one hour. But I do not think that I will change the design because of this problem. The Nmea0183 specification refers that it should comply with the norm RS422. RS422 refers that the voltages should be between 3V and 5.5V. But in order to work with ancient RS232 talkers, the A and B input terminals should support 15V. The present 1K input resistor with an input voltage of 15V imposes an Input-ON current of about 13mA. This should be compared with the maximum average input current of the A2363N which is 10mA. If we used 500R the Input-ON current would be 26mA which is not acceptable given the maximum average of 10mA. On the other hand, when the input resistance is high more listeners can receive data from the same talker and the Rin of the talker (something that I did not address here) has less effect.

What I propose to Eric is either to build a "level increaser" small board or the simple solution that I am testing while writing this post. The simple solution is to put in parallel with the input 1K resistor another 1K resistor. The equivalent resistor of the parallel will be 500R. There are 4x 1K isolated resistors in the 8pin resistor array R1. Each of these 4 resistors "belong" to one of the 4 input ports. In the picture, I placed the parallel resistor to bring the equivalent input resistance of P1 from 1K to 500R.

1674792172448.jpg

This is all for now. I am grateful to Eric to call my attention to this problem.

Best Regards, Luis

Post Reply