Industruino RTC

Hi!

Today I've been following the example of this guide about the RTC: https://industruino.com/blog/our-news-1/post/d21g-features-30 and I've uploaded the example code, I've found that, after doing that, when I try to read the mac of the industruino the board gets stuck, the method I use to read it is the same of the Industruino ethernet client example: 

void readMACfromRTC() {
  Wire.begin();                                 // I2C for RTC MAC
  SerialUSB.print("Reading MAC from RTC EEPROM: ");
  int mac_index = 0;
  for (int i = 0; i < 8; i++) {   // read 8 bytes of 64-bit MAC address, 3 bytes valid OUI, 5 bytes unique EI
    byte m = readByte(0x57, 0xf0 + i);
    SerialUSB.print(m, HEX);
    if (i < 7) SerialUSB.print(":");
    if (i != 3 && i != 4) {       // for 6-bytes MAC, skip first 2 bytes of EI
      mac[mac_index] = m;
      mac_index++;
    }
  }
  SerialUSB.println();
  SerialUSB.print("Extracted 6-byte MAC address: ");
  for (int u = 0; u < 6; u++) {
    SerialUSB.print(mac[u], HEX);
    if (u < 5) SerialUSB.print(":");
  }
  SerialUSB.println();
}

Also I've realized that with the example code of the RTC my industruino doesnt show the datetime. I've tried the RTC example without using a CR1220 battery, so in the code, the first time I've uploaded it I put RTCind.start() to false (I don't know if its correct, thats what I've understood reading the comments near the method call).

Many thanks in advance.

 

 

Jul
Jul
24
| 0 0 0
Asked on 11/8/21, 10:30 AM
0
vote
1361 Views

Hi! I use with success this library: https://github.com/Zanduino/MCP7940 That have built in the function for read (and write) the eeprom

Enrico Michieletti
on 11/9/21, 9:13 AM

Hi Enrico, I'll take a look of that library, maybe it can fix the problem, thanks :)

Jul
on 11/10/21, 10:52 AM

Hi, please start with the example code unmodified and tell us what happens exactly.

https://github.com/Industruino/democode/blob/master/MACfromRTC/MACfromRTC.ino for MAC address, note that with the code will wait until SerialUSB is connected (Serial Monitor)

https://github.com/Industruino/democode/blob/master/rtc_D21G/rtc_D21G.ino for RTC, also without battery

Tom
Tom
5675
| 1 1 3
Answered on 11/9/21, 1:34 AM
0
vote

Hi Tom, many thanks for your reply! I've tried those two examples unmodified, as you asked me to do and: 1) With the first one, the sketch uploads and the Serial monitor prints: "Get unique MAC from RTC EEPROM READING MAC from RTC EEPROM" and nothing else, the Industruino LCD backlight stills on, but nothing is printed in the screen. 2) With the second one, the serial monitor doesn't print anything and the Industruino screen prints: "RTC DEMO" one time.

Jul
on 11/9/21, 8:21 AM

Hi, assuming you have an INDIO version, can you confirm that you are powering it with 12/24V on the V+/V-. If yes, can you send us an email with the revision number and serial number of the topboard, to connect@industruino.com - you will have to remove the casing, and the numbers are on the top of the topboard next to the LCD

Tom
on 11/10/21, 1:23 AM

Hi Tom, my model is a PROTO D21G, I've tried powering it with 12V/1.5A and I have the same results, I'm sending you an email with the revision and serial number.

Jul
on 11/10/21, 8:15 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

67 follower(s)

Stats

Asked: 11/8/21, 10:30 AM
Seen: 1361 times
Last updated: 11/10/21, 10:52 AM