D21G COM port goes missing

Once I uploaded example "serial clock" from MCP7940.h library Ports in Tools->ports grayed out as there is no ports to select and error was shown "Couldn't find a Board on the selected port. Check that you have the correct port selected." After a lot of searching I found these steps to be able to select ports again

  1. Take the cover off and locate S1 ( the reset button) underneath the LCD.
  2. Connect your USB and power up the Industruino.
  3. Within 5 seconds, press S1 twice (double tap). The LCD  should now "breathe" indefinitely.
  4. Now you should find the board in the Tools -> Port menu. Select it.
  5. Upload an empty sketch to the Industruino.

After doing that I uploaded my sketch and it said done uploading but it doesn't work (same sketch did work before trying to upload "serial clock") and when I click on serial monitor ports go gray again and I get error "Board at COMxy is not available"

 

 

Nikola
Nikola
4
| 2 1 1
Asked on 5/30/18, 9:23 PM
0
vote
4108 Views

I'm digging up this old post in the hope my info helps someone else in the future. I had the exact same problem and after nearly a day of seraching I found the solution.

You can't use the Indio library functions BEFORE you call setup(). I had some code that ran on an Arduino Mega that constructed an object before setup() and in that constructor, pinMode() was called. I had changed my mega code to suit the D21G and used Indio.digitalMode() inside that constructor and that's where the problem occured.

In regular arduinos, you're not supposed to use pinMode or digitalReads/Writes outside setup() and loop() either but in the code that I was running, it quietly kept on working on the mega without any obvious issue. 

I made an account for this post. I hope it helps someone! 

Harrison
Harrison
4
| 0 0 0
Answered on 10/14/22, 10:20 AM
0
vote

Hi, the library example will not work unmodified, you need to change a couple of things so it's better to start from our example https://github.com/Industruino/democode/blob/master/rtc_D21G/rtc_D21G.ino

Can you try this and let us know if that works for you.

The procedure you describe to reset the unit is correct, it is also included in our doc at https://github.com/Industruino/libraries 

Tom
Tom
5675
| 1 1 3
Answered on 5/30/18, 11:47 PM
0
vote

Hi, What makes the rtc_D21G.ino to work? I need to integrate the code into a much more complex software, but i always loose the comport... apreciate the help.Thanks Jonas

Jonas Fehr
on 8/14/20, 2:36 PM

Hi, the main thing to note is that the USB serial is called 'SerialUSB'; if you try to print to 'Serial', which is connected to D0/D1 and the RS485, your sketch may get stuck

Tom
on 8/17/20, 12:33 AM

Hi Tom,

we tried exactly that example (https://github.com/Industruino/democode/blob/master/rtc_D21G/rtc_D21G.ino), but now are faceing problems that no other sketches work.

What was done:
1) sketch rtc_D21G.ino was uploaded
2) D21G bricked - USB connection to the PC was lost
3) followed restore procedure as described in later post
4) D21G was unbricked, looking good
5) completely different sketch was uploaded with no warnings, but when Serial Monitor in Arduino was activated, D21G bricked again (USB connection to the PC is lost)

This happens continuously now. Please advise.

Marko
Marko
7
| 2 1 2
Answered on 5/31/18, 8:43 AM
0
vote

Hi Marko, sorry to hear about that. Let's take a step back to make sure it is a hardware problem. Assuming that you have an INDIO unit, can you confirm that you are powering it with external 12/24V on V+/V-. Then upload the standard Blink sketch, changing LED_BUILTIN to 26 which is the LCD backlight. If that works fine, try the rtc_D21G.ino again, with the Serial Monitor. You are aware that the USB Serial port is called 'SerialUSB' right? Can you try another demo sketch that uses SerialUSB, e.g. https://github.com/Industruino/democode/blob/master/IndustruinoDemoCode_D21G/IndustruinoDemoCode_D21G.ino

Tom
on 5/31/18, 10:20 AM
Hi Tom,
 
I really appreciate your quick answer!
 
Yes, INDIO D21G was powered with 24V DIN rail supply (Meanwell) <IMG class="wlEmoticon wlEmoticon-smile" style="BORDER-TOP-STYLE: none; BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none" alt=Smile src="cid:C2C6E6A8BBF7435784891936C366A1E8@T">
 
We still had some problems with uploading sketches and had to repeat mentioned full “unbrick” procedure for 6 times (sometimes the sketches were uploaded without errors but did not work at all – nothing was happening as it was an empty sketch).
After that 6 hard resets it started working ok and currently it seems it is still working ok.
 
I really do not understand what is happening, especially as I already own several older models - INDIO 1286 modules - and never had any problems with them (some of them are operating perfectly under industrial conditions for almost two years). I am afraid it could be due to its internal memory problems, but have to confirm this.
 
If something happens again, I will send you an email with detailed description.
 
All the best,
Marko
 
 
 
From: Tom
Sent: Thursday, May 31, 2018 12:20 PM
To: Marko
Subject: Re: D21G COM port goes missing (560)
 

Hi Marko, sorry to hear about that. Let's take a step back to make sure it is a hardware problem. Assuming that you have an INDIO unit, can you confirm that you are powering it with external 12/24V on V+/V-. Then upload the standard Blink sketch, changing LED_BUILTIN to 26 which is the LCD backlight. If that works fine, try the rtc_D21G.ino again, with the Serial Monitor. You are aware that the USB Serial port is called 'SerialUSB' right? Can you try another demo sketch that uses SerialUSB, e.g. https://github.com/Industruino/democode/blob/master/IndustruinoDemoCode_D21G/IndustruinoDemoCode_D21G.ino

--
Tom
Sent by Industruino using Odoo about Forum Post D21G COM port goes missing (560)
on 5/31/18, 11:14 AM

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

45 follower(s)

Stats

Asked: 5/30/18, 9:23 PM
Seen: 4108 times
Last updated: 10/14/22, 10:20 AM