Constant reset loop - Devia Robotics Control board v1.0 µC-type ATSAMD21G18 (same as Arduino ZERO) with AT-firmware ESP8266-module

I am new, I am probably out of my depth but I am trying so here goes...
I purchased this as part of a camera slider kit. The board should generate its own wifi network however it only does so for a second and then stops. Upon viewing the serial monitor I can see a few resets and timeouts. Snippet and code below.
I have searched this site for quite a while. I've seen some comments on power supply's and I have tried 12v @ 2amp, 3amp and 5amp and no difference.
Ive also seen a lot of comments about watchdog but I have not idea what this is or how to control it.
The original supplier is insisting the code is fine, they sent me a second board which also does the same so I'm open to help but I am a green newbie!

Camera Slider project
WIFI init

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x40100000, len 1856, room 16 
tail 0
chksum 0x63
load 0x3ffe8000, len 776, room 8 
tail 0
chksum 0x02
load 0x3ffe8310, len 552, room 8 
tail 0
chksum 0x79
csum 0x79

2nd boot vAT


OK

AT+GMR

AT version:1.2.0.0(Jul  1 2016 20:04:45)
SDK version:1.5.4.1(39cb9a32)
Ai-Thinker Technology Co. Ltd.
Dec  2 2016 14:21:16
OK

AT+CIPSTAMAC?

+CIPSTAMAC:"10:52:1c:e4:1f:85"

OK
MAC:10521CE41F85

AT+CWMODE=2


OK

AT+CWSAP="JJROBOTS_85","87654321",5,3


OK
Start UDP server

!Timeout!

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x40100000, len 1856, room 16 
tail 0
chksum 0x63
load 0x3ffe8000, len 776, room 8 
tail 0
chksum 0x02
load 0x3ffe8310, len 552, room 8 
tail 0
chksum 0x79
csum 0x79

2nd boot version : 1.5
  SPI Speed      : 40MHz
  SPI Mode       : DIO
  SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000


Code

// CAMERA SLIDER PROJECT by JJrobots
// STEPPER MOTOR CONTROL WITH JJROBOTS NEW DEVIA M0 BOARD
// Author: Jose Julio & Juan pedro (JJROBOTS)

// Hardware: New JJROBOTS DEVIA M0 Board with Arduino M0 & ESP8266
// Board (arduino IDE): Arduino/Genuine Zero (Native USB Port)
// Date: 08/10/2019
// Version: 1.09
// Project page : http://jjrobots.com/cameraslider
// License: Open Software GPL License v2

// Hardware:
// X Motor (longitudinal move) connected to MOTOR1 output
// Y Motor (camera rotation) connected to MOTOR2 output

#define VERSION "1.10"

// ROBOT configuration parameters
#include "Configuration.h"

// Configuration: Pins, servos, Steppers, Wifi...
void setup()
{
  // STEPPER PINS ON JJROBOTS BROBOT BRAIN BOARD
  pinMode(11, OUTPUT); // ENABLE MOTORS   ATSAMD21:PA16
  pinMode(5, OUTPUT); // STEP MOTOR 1 ATSAMD21:PA15  
  pinMode(6, OUTPUT); // DIR MOTOR 1  ATSAMD21:PA20
  pinMode(7, OUTPUT); // STEP MOTOR 2 ATSAMD21:PA21
  pinMode(8, OUTPUT); // DIR MOTOR 2  ATSAMD21:PA06
  pinMode(9, OUTPUT); // STEP MOTOR 3 ATSAMD21:PA07
  pinMode(10, OUTPUT); // DIR MOTOR 3  ATSAMD21:PA18

  pinMode(A4, OUTPUT);   // Microstepping output
  digitalWrite(A4, HIGH); // 1/16

  pinMode(3, OUTPUT); // SERVO1  ATSAMD21:PA09 //Servo outputs not used 
  pinMode(4, OUTPUT); // SERVO2  ATSAMD21:PA08

  pinMode(12, OUTPUT); // output (PA19)
  digitalWrite(12, LOW); //Disable
  
  digitalWrite(11, HIGH);  // Disbale motors

  // LEDS
  pinMode(RED_LED, OUTPUT); // RED LED
  pinMode(GREEN_LED, OUTPUT); // GREEN LED

  // RED LED ON STARTUP
  digitalWrite(RED_LED, HIGH);
  digitalWrite(GREEN_LED, LOW);

  delay(100);
  SerialUSB.begin(115200);   // Serial output to console
  //while (!Serial);      // Arduino Leonardo wait for Serial port to open...
  Serial1.begin(115200); // Wifi initialization

  // Button pressed at init?
  //if (digitalRead(A0) == LOW)
  //  SerialUSB.print("Button pressed at init...");
  delay(2000);
  SerialUSB.println("Camera Slider project");
  
  // WIFI MODULE INITIALIZATION PROCESS
  SerialUSB.println("WIFI init");
  delay(200);
  
  Serial1.flush();
  Serial1.print("+++");  // To ensure we exit the transparent transmision mode
  delay(100);
  ESPsendCommand(String("AT"), String("OK"), 1);
  //ESPsendCommand("AT+RST", "OK", 2); // ESP Wifi module RESET
  //ESPwait("ready", 6);
  ESPsendCommand(String("AT+GMR"), String("OK"), 5);

  // Deafault : we generate a wifi network
  Serial1.println("AT+CIPSTAMAC?");
  ESPgetMac();
  SerialUSB.print("MAC:");
  SerialUSB.println(MAC);
  delay(100);
  //ESPsendCommand("AT+CWQAP", "OK", 3);
  ESPsendCommand(String("AT+CWMODE=2"), String("OK"), 3); // Soft AP mode
  // Generate Soft AP. SSID=JJROBOTS_XX, PASS=87654321
  String cmd =  String("AT+CWSAP=\"JJROBOTS_") + MAC.substring(MAC.length() - 2, MAC.length()) + String("\",\"87654321\",5,3");
  ESPsendCommand(cmd, String("OK"), 6);

  // Start UDP SERVER on port 2222, telemetry port 2223
  SerialUSB.println("Start UDP server");
  ESPsendCommand(String("AT+CIPMUX=0"), String("OK"), 3);  // Single connection mode
  ESPsendCommand(String("AT+CIPMODE=1"), String("OK"), 3); // Transparent mode
  String Telemetry = String("AT+CIPSTART=\"UDP\",\"") + String(TELEMETRY) + String("\",2223,2222,0");
  ESPsendCommand(Telemetry, String("CONNECT"), 3);
  SerialUSB.println(Telemetry);
  delay(200);
  ESPsendCommand(String("AT+CIPSEND"), String('>'), 2); // Start transmission (transparent mode) 

  delay(250);
  SerialUSB.println();
  SerialUSB.print("Camera Slider project v");
  SerialUSB.println(VERSION);
  
  // Output parameters
  SerialUSB.print("Max_acceleration_x: ");
  SerialUSB.println(acceleration_M1);
  SerialUSB.print("Min speed X: ");
  SerialUSB.println(MIN_SPEED_M1);
  SerialUSB.print("Max speed X: ");
  SerialUSB.println(MAX_SPEED_M1);
  
  // STEPPER MOTORS INITIALIZATION
  SerialUSB.println("Steper motors initialization...");
  timersConfigure();
  SerialUSB.println("Timers initialized");
  delay(200);
  // Initializing Robot command variables
  max_speed_M1 = MAX_SPEED_M1;
  max_speed_M2 = MAX_SPEED_M2;
  //Initializing init position
  position_M1 = ROBOT_INITIAL_POSITION_X * X_AXIS_STEPS_PER_UNIT;
  position_M2 = 0;
 
  timersStart(); //starts the timers
  SerialUSB.println("Timers started");

  digitalWrite(GREEN_LED, HIGH);
  delay(50);
  digitalWrite(GREEN_LED, LOW);
  delay(50);
  digitalWrite(GREEN_LED, HIGH);
  delay(50);
  digitalWrite(GREEN_LED, LOW);
  digitalWrite(RED_LED, LOW);
  SerialUSB.print("Robot position:");
  SerialUSB.println(position_M1/X_AXIS_STEPS_PER_UNIT);
  SerialUSB.println(" Ready... waiting...");
  CameraSliderDirection=-1;
  dt2_period=50000;
  timer_old1 = micros();
  timer_old2 = timer_old1;
}

void loop()
{
  float distance_to_object=0.0;
  float distance_to_max;
  float newSpeed;
  int i;
  
  MsgRead();
  if (newMessage)
  {
    newMessage = 0;

    if (CameraSliderState == 5){
      newSpeed = (CameraSpeed/1000.0)*(MAX_SPEED_M1-MIN_SPEED_M1)+MIN_SPEED_M1;
      setSpeedS(newSpeed);
      SerialUSB.print("Speed:");
      SerialUSB.print(CameraSpeed);
      SerialUSB.print(" (");
      SerialUSB.print(newSpeed); // Speed in steps/seg
      SerialUSB.println(")");
    }

    if (CameraSliderState == 4){
      if (oldCameraSliderState==0){
        SerialUSB.println("CONTINUE WITH DELAY...");
        for (i=15;i>=0;i--){
          SerialUSB.println(i);
          digitalWrite(GREEN_LED, HIGH);  //LED ON
          delay(500);
          digitalWrite(GREEN_LED, LOW);  //LED OFF
          delay(500);
        }
        CameraSliderState=2;  // Continue normaly...
        }
      else
        SerialUSB.println("We could not resume if we are not stopped!");
    }

    if (CameraSliderState == 3){
      if (oldCameraSliderState==0){
        SerialUSB.println("START FROM INIT WITH DELAY...");
        for (i=15;i>=0;i--){
          SerialUSB.println(i);
          digitalWrite(GREEN_LED, HIGH);  //LED ON
          delay(500);
          digitalWrite(GREEN_LED, LOW);  //LED OFF
          delay(500);
        }
        CameraSliderState=1;  // Start normaly...
      }
      else
        SerialUSB.println("We could not start if we are not stopped!");
    }
    
    
    if ((CameraSliderState == 1)||(CameraSliderState == 2)){
      if (oldCameraSliderState==0){
        newSpeed = (CameraSpeed/1000.0)*(MAX_SPEED_M1-MIN_SPEED_M1)+MIN_SPEED_M1;
        setSpeedS(newSpeed);
        digitalWrite(11, LOW); // Enable motors
  	    move_motor=true;
        SerialUSB.println("START MOTORS!");
        SerialUSB.print("Rail length:");
        SerialUSB.println(SliderSize);
        if (ObjectDistance==0){
          SerialUSB.println("No object tracking...");
        }
        else{
          SerialUSB.println("Object tracking");
          SerialUSB.print("  Object-rail distance:");
          SerialUSB.println(ObjectDistance);
          SerialUSB.print("  Camera-object distance:");
          SerialUSB.println(ObjectPosition);
        }
        SerialUSB.print("Speed:");
        SerialUSB.print(CameraSpeed);
        SerialUSB.print(" (");
        SerialUSB.print(newSpeed); // Speed in steps/seg
        SerialUSB.println(")");
        if (CameraSliderState == 1){
          SerialUSB.println("=>Start from init position...");
          // Initial position: 0
          setPosition_mm10(SliderSize * 10);           
          CameraSliderDirection=-1; // Initial going to max...
          position_M1 = 0;
        }
        else{
          SerialUSB.println("=>Resume from actual position...");
        }
        // Initial angle: We suposse that the camera is already pointing to the object
        if (ObjectDistance==0){
          position_M2=0;
          speed_M2=0;
          dir_M2=0;
        }
        else{
          distance_to_object = float(ObjectPosition)-(float(position_M1)/float(X_AXIS_STEPS_PER_UNIT));
          position_M2 = atan2(distance_to_object,float(ObjectDistance))*RAD2GRAD*Y_AXIS_STEPS_PER_UNIT;
          target_angle_M2 = position_M2; // We suppose to start in the right direction
        }
        SerialUSB.print("Initial camera angle:");
        SerialUSB.println(target_angle_M2/Y_AXIS_STEPS_PER_UNIT);
        SerialUSB.print("Camera position:");
        SerialUSB.println(position_M1/X_AXIS_STEPS_PER_UNIT);
        SerialUSB.print("Target:");
        SerialUSB.println(target_position_M1);
        digitalWrite(GREEN_LED, HIGH);  //LED ON
        max_speed_M1 = MAX_SPEED_M1;
        max_speed_M2 = MAX_SPEED_M2;
      }
      else
        SerialUSB.println("We could not start or continue if we are not stopped!");
    }
    
    if (CameraSliderState == 0)
    {
      SerialUSB.println("STOP MOTORS!");
      max_speed_M1 = 0;
      max_speed_M2 = 0;
      //digitalWrite(11, HIGH);  // Disbale motors 
      //dir_M1=0;
      //dir_M2=0;
      //digitalWrite(GREEN_LED, LOW);  //LED OFF
    }
    /*
    if (newSpeed < 10)
      dt2_period = 400000;  // 2.5Hz
    else if (newSpeed < 100)
      dt2_period = 200000;  // 5Hz
    else if (newSpeed < 500)
      dt2_period = 100000;  // 10Hz
    else 
      dt2_period = 50000;   // 20Hz
    */
    dt2_period = 50000;  //20hz
  } // End new message

  // Motor1 control
	timer_value = micros();
  dt1 = timer_value - timer_old1;
  if (dt1 >= 5000) { //40000=> 25hz 20000 => 50hz 10000=>100hz loop 5000=>200hz 4000=>250hz 2000 => 500hz loop
    timer_old1 = timer_value;
    if (CameraSliderState == 0){
      // If we are stopped=>Disable motors
      if ((speed_M1==0)&&(speed_M2==0))
      {
        move_motor=false;
        digitalWrite(11, HIGH);  // Disbale motors
        dir_M1=0;
        dir_M2=0;
        digitalWrite(GREEN_LED, LOW);  //LED OFF
      }
    }
    if (move_motor) {
      
      positionControl(dt1);   // position, speed and acceleration control of stepper motors
      
      if (robot_stopped){  // End of movement? == rail end?
        if (end_wait_counter==0)
          SerialUSB.println("STOP!");
        end_wait_counter++; 
        if (end_wait_counter>ENDWAIT){
          end_wait_counter=0;
          distance_to_max = abs(position_M1-long(SliderSize)*X_AXIS_STEPS_PER_UNIT);
          // Start the reverse movent
          if (distance_to_max<500.0){
            SerialUSB.println("...GOING TO ROBOT MIN...");
            setPosition_mm10(0);
            CameraSliderDirection=1;
          }  
          else{
            SerialUSB.println("...GOING TO ROBOT MAX...");
            setPosition_mm10(SliderSize * 10);
            CameraSliderDirection=-1;
          }
          SerialUSB.print("Target:");
          SerialUSB.println(target_position_M1);
        }
      } // if (robot_stopped)
    }  // if (move_motor)
  } // 100hz Motor1 control loop
  // Motor2 control
  timer_value = micros();
  dt2 = timer_value - timer_old2;
  if (dt2 >= dt2_period) { 
    timer_old2 = timer_value;
    loop_counter++;
    if (move_motor) {
      if (ObjectDistance==0){
        target_angle_M2=0;
        speed_M2=0;
        dir_M2=0;
      }
      else{
        distance_to_object = float(ObjectPosition)-(float(position_M1)/float(X_AXIS_STEPS_PER_UNIT));
        target_angle_M2_old = target_angle_M2;
        target_angle_M2 = atan2(distance_to_object,float(ObjectDistance))*RAD2GRAD*Y_AXIS_STEPS_PER_UNIT;
        //angleControl(target_angle_M2,dt2);
        angleControl(dt2);
      }
      // DEBUG TO CONSOLE: position and angle
      if(1==1){
      SerialUSB.print("P:");
      SerialUSB.print(float(position_M1)/X_AXIS_STEPS_PER_UNIT);
      SerialUSB.print(" ");
      SerialUSB.print(target_angle_M2/Y_AXIS_STEPS_PER_UNIT);
      SerialUSB.print(" A:");
      SerialUSB.print(position_M2/Y_AXIS_STEPS_PER_UNIT);
      //SerialUSB.print((target_angle_y-position_y)/Y_AXIS_STEPS_PER_UNIT);
      SerialUSB.print(" ");
      SerialUSB.print(speed_M1);
      SerialUSB.print(" ");
      SerialUSB.println(speed_M2);
      }
    }
  } // Motor2 control
}

Hi James,

welcome to the arduino-forum.
Did you upload the code you have posted to the ESP8266?

As this code uses AT-commands I guess this code should run on some other microcontroller that is communicating with the ESP8266-board where the ESP8266-board is running the "AT-firmware"

Did you try to upload / flash a basic blink-sketch?
Try this demo-sketch if the ESP8266-board works at all
Most ESP8266-boards have an onboard LED connected to GPIO-pin 2
Thi sketch does two things make the LED blink and print "Hello World" to the serial monitor once per second

// MACRO-START * MACRO-START * MACRO-START * MACRO-START * MACRO-START * MACRO-START *

// a detailed explanation how these macros work is given in this tutorial
// https://forum.arduino.cc/t/comfortable-serial-debug-output-short-to-write-fixed-text-name-and-content-of-any-variable-code-example/888298

#define dbg(myFixedText, variableName) \
  Serial.print( F(#myFixedText " "  #variableName"=") ); \
  Serial.println(variableName);
// usage: dbg("1:my fixed text",myVariable);
// myVariable can be any variable or expression that is defined in scope

#define dbgi(myFixedText, variableName,timeInterval) \
  do { \
    static unsigned long intervalStartTime; \
    if ( millis() - intervalStartTime >= timeInterval ){ \
      intervalStartTime = millis(); \
      Serial.print( F(#myFixedText " "  #variableName"=") ); \
      Serial.println(variableName); \
    } \
  } while (false);
// usage: dbgi("2:my fixed text",myVariable,1000);
// myVariable can be any variable or expression that is defined in scope
// third parameter is the time in milliseconds that must pass by until the next time a
// Serial.print is executed
// end of macros dbg and dbgi
// MACRO-END * MACRO-END * MACRO-END * MACRO-END * MACRO-END * MACRO-END * MACRO-END *


int myCounter;

void PrintFileNameDateTime() {
  Serial.println( F("Code running comes from file ") );
  Serial.println( F(__FILE__) );
  Serial.print( F("  compiled ") );
  Serial.print( F(__DATE__) );
  Serial.print( F(" ") );
  Serial.println( F(__TIME__) );
}


// easy to use helper-function for non-blocking timing
boolean TimePeriodIsOver (unsigned long &startOfPeriod, unsigned long TimePeriod) {
  unsigned long currentMillis  = millis();
  if ( currentMillis - startOfPeriod >= TimePeriod ) {
    // more time than TimePeriod has elapsed since last time if-condition was true
    startOfPeriod = currentMillis; // a new period starts right here so set new starttime
    return true;
  }
  else return false;            // actual TimePeriod is NOT yet over
}

unsigned long MyTestTimer = 0;                   // Timer-variables MUST be of type unsigned long
const byte    OnBoard_LED = 2;


void BlinkHeartBeatLED(int IO_Pin, int BlinkPeriod) {
  static unsigned long MyBlinkTimer;
  pinMode(IO_Pin, OUTPUT);

  if ( TimePeriodIsOver(MyBlinkTimer, BlinkPeriod) ) {
    digitalWrite(IO_Pin, !digitalRead(IO_Pin) );
  }
}


void setup() {
  Serial.begin(115200);
  Serial.println("Setup-Start");
  PrintFileNameDateTime();
  myCounter = 0;
}


void loop() {
  BlinkHeartBeatLED(OnBoard_LED, 100);
  if ( TimePeriodIsOver(MyTestTimer, 1000) ) {
    Serial.println("Hello World");
    myCounter++;
    dbg("Test", myCounter);
  }

}

You should see this in the serial output:

15:51:39.938 -> Code running comes from file 
15:51:39.938 -> ESP8266-Blink-Demo-001.ino
15:51:39.938 ->   compiled May 26 2022 15:48:22
15:51:40.852 -> Hello World
15:51:40.852 -> "Test" myCounter=1
15:51:41.837 -> Hello World
15:51:41.837 -> "Test" myCounter=2
15:51:42.857 -> Hello World
15:51:42.857 -> "Test" myCounter=3
15:51:43.840 -> Hello World
15:51:43.840 -> "Test" myCounter=4
15:51:44.858 -> Hello World
15:51:44.858 -> "Test" myCounter=5
15:51:45.832 -> Hello World

best regards Stefan

Thanks for the fast response.

I have not uploaded anything else other than the sketch above. I have seen some people reference the AT-firmware but for now I was just focussing on the initial code, as I say this is all new to me.

Just created a new sketch and uploaded that. The blue LED is blinking every 5-6 seconds but I am not seeing anything in the serial monitor but I'll try again.

@jamesdeandesigns
This descirption is way too unprecise

If you want to proceed fast you have to invest 3 to 5 minutes into writing a detailed description.
This will save you 15 to 500 minutes because two postings asking back and forth for details are saved away through giving the detailed information right with the first posting

Post the complete sketch that you have uploaded
using this method:
You can post code by using this method that adds the code-tags
There is an automatic function for doing this in the Arduino-IDE
just three steps

  1. press Ctrl-T for autoformatting your code
  2. do a rightclick with the mouse and choose "copy for forum"
  3. paste clipboard into write-window of a posting

Go to my post with the demo-code
move your mouse to the upper-right-edge of the code-section
Then there appears a symbol for copying the whole code
copy the whole code paste the clipboard into an empty sketch compile and upload

then report the results

best regards Stefan

So I clicked the New Sketch button, deleted the existing couple of lines that appear for Void setup and Void Loop, copied your code using the button and then pasted that in. Pressed CTRL-T, said no formatting was required. Saved the file. Then clicked the Upload button. It compiled, no errors appear, says verify successful, CPU Reset.

Still nothing is appearing in the Serial monitor.

This what I have copied from my side. At a glance it looks identical to what you posted but please advise otherwise.

// MACRO-START * MACRO-START * MACRO-START * MACRO-START * MACRO-START * MACRO-START *
// Take it for granted at the moment scroll down to void setup
// start of macros dbg and dbgi
#define dbg(myFixedText, variableName) \
  Serial.print( F(#myFixedText " "  #variableName"=") ); \
  Serial.println(variableName);
// usage: dbg("1:my fixed text",myVariable);
// myVariable can be any variable or expression that is defined in scope

#define dbgi(myFixedText, variableName,timeInterval) \
  do { \
    static unsigned long intervalStartTime; \
    if ( millis() - intervalStartTime >= timeInterval ){ \
      intervalStartTime = millis(); \
      Serial.print( F(#myFixedText " "  #variableName"=") ); \
      Serial.println(variableName); \
    } \
  } while (false);
// usage: dbgi("2:my fixed text",myVariable,1000);
// myVariable can be any variable or expression that is defined in scope
// third parameter is the time in milliseconds that must pass by until the next time a
// Serial.print is executed
// end of macros dbg and dbgi
// MACRO-END * MACRO-END * MACRO-END * MACRO-END * MACRO-END * MACRO-END * MACRO-END *


int myCounter;

void PrintFileNameDateTime() {
  Serial.println( F("Code running comes from file ") );
  Serial.println( F(__FILE__) );
  Serial.print( F("  compiled ") );
  Serial.print( F(__DATE__) );
  Serial.print( F(" ") );
  Serial.println( F(__TIME__) );
}


// easy to use helper-function for non-blocking timing
boolean TimePeriodIsOver (unsigned long &startOfPeriod, unsigned long TimePeriod) {
  unsigned long currentMillis  = millis();
  if ( currentMillis - startOfPeriod >= TimePeriod ) {
    // more time than TimePeriod has elapsed since last time if-condition was true
    startOfPeriod = currentMillis; // a new period starts right here so set new starttime
    return true;
  }
  else return false;            // actual TimePeriod is NOT yet over
}

unsigned long MyTestTimer = 0;                   // Timer-variables MUST be of type unsigned long
const byte    OnBoard_LED = 2;


void BlinkHeartBeatLED(int IO_Pin, int BlinkPeriod) {
  static unsigned long MyBlinkTimer;
  pinMode(IO_Pin, OUTPUT);

  if ( TimePeriodIsOver(MyBlinkTimer, BlinkPeriod) ) {
    digitalWrite(IO_Pin, !digitalRead(IO_Pin) );
  }
}


void setup() {
  Serial.begin(115200);
  Serial.println("Setup-Start");
  PrintFileNameDateTime();
  myCounter = 0;
}


void loop() {
  BlinkHeartBeatLED(OnBoard_LED, 100);
  if ( TimePeriodIsOver(MyTestTimer, 1000) ) {
    Serial.println("Hello World");
    myCounter++;
    dbg("Test", myCounter);
  }

}

Did you try the above addition? Did you get prints?

I think the problem is wrong baudrate in the serial monitor adjust baudrate to 115200

There is mising the comment-slashes
Serial.println(" nothing ");// <<<<<add this line

I have added that line without the comment (as in I deleted the extra text), but still nothing is coming through on the monitor.

I went back and uploaded my original sketch that I posted at the top and information comes through on the monitor.

Just to be sure, I went back to the demo you posted, uploaded that and still nothing appears on the monitor. The baud rate has been on 115200 from the start.

what happens if you press the reset-button?
set baudrate in the serial monitor to 115200
clear the serial monitor then press the reset-button

change baudrate to 74880
then press the reset-button
click into the serial monitor
press Ctr-A to mark all
press Ctrl-C to copy
paste content into a code-section

I have done that back and fourth a few times but nothing at all appears in the monitor regardless of the baud rate I select. I can hear the "Bing bong" from the PC so I know it is resetting.
The only thing that appears to change is sometimes I am getting a message in orange on the black screen when changing the rate saying
java.io.IOException: jssc.SerialPortException: POrt name - COM8; Method name - setEventsMask(); Exception type - Can't set mask.

click into the window with the orange text
press Ctrl-A
press Ctrl-C
paste into a code.section of a posting
after that do the most beloved thing each modern electronic device loves most to do:

reboot your computer

So I'm still getting nothing in the monitor from your code. Not sure if it makes a difference but I'm on the Native USB port as opposed to the programming port.

This is the usual readout I get from the upload

Sketch uses 12400 bytes (4%) of program storage space. Maximum is 262144 bytes.
Global variables use 2948 bytes of dynamic memory.
Atmel SMART device 0x10010005 found
Device       : ATSAMD21G18A
Chip ID      : 10010005
Version      : v2.0 [Arduino:XYZ] Dec 20 2016 15:36:39
Address      : 8192
Pages        : 3968
Page Size    : 64 bytes
Total Size   : 248KB
Planes       : 1
Lock Regions : 16
Locked       : none
Security     : false
Boot Flash   : true
BOD          : true
BOR          : true
Arduino      : FAST_CHIP_ERASE
Arduino      : FAST_MULTI_PAGE_WRITE
Arduino      : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
done in 0.828 seconds

Write 12400 bytes to flash (194 pages)

[=========                     ] 32% (64/194 pages)
[===================           ] 65% (128/194 pages)
[============================= ] 98% (192/194 pages)
[==============================] 100% (194/194 pages)
done in 0.094 seconds

Verify 12400 bytes of flash with checksum.
Verify successful
done in 0.011 seconds
CPU reset.

If I click the reset button and try to upload the code I initially get this error

java.io.IOException: jssc.SerialPortException: Port name - COM8; Method name - setEventsMask(); Exception type - Can't set mask.
	at processing.app.Serial.dispose(Serial.java:166)
	at processing.app.SerialMonitor.close(SerialMonitor.java:116)
	at processing.app.AbstractMonitor.suspend(AbstractMonitor.java:90)
	at processing.app.Editor$DefaultExportHandler.run(Editor.java:2022)
	at java.lang.Thread.run(Thread.java:748)
Caused by: jssc.SerialPortException: Port name - COM8; Method name - setEventsMask(); Exception type - Can't set mask.
	at jssc.SerialPort.setEventsMask(SerialPort.java:279)
	at jssc.SerialPort.removeEventListener(SerialPort.java:1064)
	at jssc.SerialPort.closePort(SerialPort.java:1090)
	at processing.app.Serial.dispose(Serial.java:163)
	... 4 more

This message shows that you have configured the Arduino-IDE to a completely wrong board

This 1000% not an ESP8266
You wrote that you are new to this.
But somehow you managed to give the impression that you know what you are doing.

After seeing that you have adjusted the wrong board I have the greatest doubts about everything !

Me personally I will only answer again if you have read this

and only if you have posted information
item for item that is listed in this guide

I even doubt that you are using an ESP8266

Write sufficient information about

  • Hardware
    post a high-resolution picture of your board

  • follow the paragraph General

  • witness that you have done some

OWN Research

  • Be specific

  • write About you

    • your knowledge-level about programming
    • your knowledge-level about electronics

if anybody else wants to take over go ahead

Wow, how patronising!
I said from the start I am new to this, you misinterpreting what I am writing and believing I know more than I do is not my fault. I even posted a link to the hardware I am using so I couldn't have been any clearer than I already have been. If I listed a part incorrectly I apologise but whenever I search for ESP-12F (which is what I have) its always listed with the code ESP8266 so its valid for me to believe that is the part.
As someone who runs multiple CNC groups dedicated to helping people, and a YouTube channel with 30k subscribers and over 2 million views helping people get into CNC, I'm fully aware of how to help beginners. I literally spend all my spare time helping beginners get into CNC are your patronising approach does not help anyone. In fact it puts beginner off asking for help because you belittle them.
Thanks for nothing!

Sure you can
change the the

title

to

"Devia Robotics Control board v1.0 µC-type ATSAMD21G18 (same as Arduino ZERO) with AT-firmware ESP8266-module"

add this picture to the first posting

This website has testcode provided by the manufacturer
https://www.jjrobots.com/devia-control-board-test-code/

There is this testcode

// JJROBOTS
// TEST CODE NEW DEVIA BOARD

// TEST: WIFI MODULE,IMU, LEDS, SWITCH,SERVOS, STEPPERS
//
// Author: JJROBOTS.COM
// Date: 21/08/2019
// Version: 1.01
// Compiled and tested with Arduino 1.8.3 This code does not need external libraries (only Arduino standard libraries)

#include <Servo.h>
#include <Wire.h>

#define RAD2GRAD 57.2957795

#define GREEN_LED A1
#define RED_LED A2
#define SWITCH_IN 30

// Servo definitions
#define SERVO1_NEUTRAL 1500  // Servo neutral position Gripped angle
#define SERVO1_MIN_PULSEWIDTH 1000
#define SERVO1_MAX_PULSEWIDTH 2000
#define SERVO2_NEUTRAL 1500  // Servo neutral position
#define SERVO2_MIN_PULSEWIDTH 1000
#define SERVO2_MAX_PULSEWIDTH 2000
#define SERVO3_NEUTRAL 1500  // Servo neutral position Gripped angle
#define SERVO3_MIN_PULSEWIDTH 1000
#define SERVO3_MAX_PULSEWIDTH 2000
#define SERVO4_NEUTRAL 1500  // Servo neutral position
#define SERVO4_MIN_PULSEWIDTH 1000
#define SERVO4_MAX_PULSEWIDTH 2000

int16_t BatteryValue;

long timer_old;
long timer_value;
float dt;

float MPU_yaw_angle;

long servo_counter;
int16_t servo_pos1;
int16_t servo_pos2;
int16_t servo_pos3;
int16_t servo_pos4;
bool servo1_ready=false;
bool servo2_ready=false;
bool servo3_ready=false;
bool servo4_ready=false;

Servo servo1; 
Servo servo2; 
Servo servo3; 
Servo servo4; 

int wifi_status;
int imu_error;

// Return board switch state
bool board_switch_pressed()
{
  return !(REG_PORT_IN1 & PORT_PB03);
}

// INITIALIZATION
void setup()
{
  // STEPPER PINS ON JJROBOTS DEVIA M0 BOARD
  pinMode(11, OUTPUT); // ENABLE MOTORS   ATSAMD21:PA16
  pinMode(5, OUTPUT); // STEP MOTOR 1 ATSAMD21:PA15
  pinMode(6, OUTPUT); // DIR MOTOR 1  ATSAMD21:PA20
  pinMode(7, OUTPUT); // STEP MOTOR 2 ATSAMD21:PA21
  pinMode(8, OUTPUT); // DIR MOTOR 2  ATSAMD21:PA06
  pinMode(9, OUTPUT); // STEP MOTOR 3 ATSAMD21:PA07
  pinMode(10, OUTPUT); // DIR MOTOR 3  ATSAMD21:PA18

  pinMode(A4, OUTPUT);    // Microstepping output
  digitalWrite(A4, HIGH); // 1/16 (default config)

  pinMode(RED_LED, OUTPUT); // RED LED
  pinMode(GREEN_LED, OUTPUT); // GREEN LED
  pinMode(SWITCH_IN, INPUT_PULLUP);  // Input Switch
  digitalWrite(SWITCH_IN,OUTPUT); // PULLUP
  //PORT->Group[PORTB].PINCFG[3].reg = (uint8_t)(PORT_PINCFG_INEN|PORT_PINCFG_PULLEN); // INPUT PIN
  //PORT->Group[PORTB].PINCFG[3].DIRCLR.reg = (uint32_t)(1<<3); // DIR
  //PORT->Group[PORTB].PINCFG[3].OUTSET.reg = (uint32_t)(1<<3); // PULLUP

  digitalWrite(11, HIGH);  // Disbale stepper motors

  SerialUSB.begin(115200); // Serial output to console
  Serial1.begin(115200);
  SerialUSB.println("Init...");
 
  digitalWrite(RED_LED, LOW);
  digitalWrite(GREEN_LED, LOW);

  Wire.begin();

  delay(1000);
  digitalWrite(RED_LED, HIGH);
  delay(500);

  SerialUSB.println();
  SerialUSB.println("JJROBOTS DEVIA BOARD TEST CODE v1.0");
  SerialUSB.println();
  delay(100);
   
  if (board_switch_pressed()) // Switch on?
    SerialUSB.println("SWITCH PRESSED");
  else
    SerialUSB.println("SWITCH Not Pressed");
  
  SerialUSB.println("TEST:  LEDS...");
  digitalWrite(RED_LED, HIGH);
  digitalWrite(GREEN_LED, HIGH);
  delay(400);
  digitalWrite(RED_LED, LOW);
  digitalWrite(GREEN_LED, LOW);
  delay(400);
  digitalWrite(RED_LED, HIGH);
  digitalWrite(GREEN_LED, HIGH);
  delay(400);
  digitalWrite(RED_LED, LOW);
  digitalWrite(GREEN_LED, LOW);
  delay(400);
  digitalWrite(RED_LED, HIGH);
  digitalWrite(GREEN_LED, HIGH);

  digitalWrite(GREEN_LED, LOW);

  SerialUSB.println("TEST: Checking IMU...");
  imu_error = MPU6050_setup();  // setup MPU6050 IMU at 50Hz
  if (imu_error>0)  // Error on IMU initialization?
    {
    while(1)
      {
      SerialUSB.println("!! ERROR ON IMU");
      digitalWrite(RED_LED, HIGH);    
      delay(200);
      digitalWrite(RED_LED, LOW);
      delay(100);
      }  
    }
  delay(200);

  // With the new ESP8266 WIFI MODULE WE NEED TO MAKE AN INITIALIZATION PROCESS
  SerialUSB.println("TEST: WIFI. Generating network JJROBOTS_TEST");
  Serial1.flush();
  Serial1.print("+++");  // To ensure we exit the transparent transmision mode
  delay(100);
  wifi_status = ESPsendCommand("AT", "OK", 1);
  //ESPsendCommand("AT+RST", "OK", 2); // ESP Wifi module RESET
  //ESPwait("ready", 6);
  ESPsendCommand("AT+GMR", "OK", 5);

  //ESPsendCommand("AT+CWQAP", "OK", 3);
  ESPsendCommand("AT+CWMODE=2", "OK", 3); // Soft AP mode
  // Generate Soft AP. SSID=JJROBOTS_TEST, PASSWORD=87654321
  char *cmd =  "AT+CWSAP=\"JJROBOTS_TEST\",\"87654321\",5,3";
  ESPsendCommand(cmd, "OK", 6);

  if (wifi_status==0)  // Error on WIFI initialization?
    {
    while(1)
      {
      SerialUSB.println("!! ERROR ON WIFI MODULE");
      digitalWrite(RED_LED, HIGH);    
      delay(200);
      digitalWrite(RED_LED, LOW);
      delay(100);
      }  
    }
  

  BatteryValue = analogRead(A0);
  SerialUSB.print("TEST: ANALOG 0 VALUE:");
  SerialUSB.println(BatteryValue);

  // Calibrate gyros NOT NEEDED FOR TEST
  // MPU6050_calibrate();
  
  digitalWrite(RED_LED, LOW);
  digitalWrite(GREEN_LED, HIGH);

  SerialUSB.println("TEST: Servos");
  // Servo test
  initServo();
  enableServo1();
  enableServo2();
  enableServo3();
  enableServo4();
  moveServo1(1800);
  moveServo2(1800);
  moveServo3(1800);
  moveServo4(1800);
  delay(1000);
  moveServo1(1200);
  moveServo2(1200);
  moveServo3(1200);
  moveServo4(1200);
  delay(1000);
  moveServo1(1500);
  moveServo2(1500);
  moveServo3(1500);
  moveServo4(1500);
  delay(1000);

  SerialUSB.println("TEST: STEPPER MOTORS");
  digitalWrite(11, LOW);  // Enable stepper motors  
  for (int i=0;i<200;i++)
    {
    // Send STEP pulses to steppers... 
    digitalWrite(5, HIGH);
    digitalWrite(7, HIGH);
    digitalWrite(9, HIGH);
    delay(1);
    digitalWrite(5, LOW);
    digitalWrite(7, LOW);
    digitalWrite(9, LOW);
    delay(20);
    }
  digitalWrite(11, HIGH);  // Disbale stepper motors


  SerialUSB.println("TEST: FET output");
  // FET output test
  pinMode(12,OUTPUT);
  digitalWrite(12,HIGH);
  delay(800);
  digitalWrite(12,LOW);
  delay(800);  
  digitalWrite(12,HIGH);
  delay(800);
  digitalWrite(12,LOW);

  // Serial test
  SerialUSB.println("TEST:  Serial... sending messages...");
  Serial.begin(9600);
  Serial.println("Somethnig to send to the UART port...");
  delay(100);
  Serial.println("Somethnig to send to the UART port...");
  delay(100);
  Serial.println("Somethnig to send to the UART port...");

  timer_old = micros();
}

// MAIN LOOP
void loop()
{
  // If Switch is pressed, LED red ON
  if (board_switch_pressed())
    digitalWrite(RED_LED,HIGH);
  else
    digitalWrite(RED_LED,LOW);
 
  /**************************************************/

  if (MPU6050_newData())
  {
    MPU6050_read_3axis();
    dt = (micros() - timer_old) * 0.000001; // dt in seconds
    timer_old = micros(); //Timer reset
    MPU_yaw_angle = MPU6050_yawAngle(dt);
    SerialUSB.print("IMU:");
    SerialUSB.println(MPU_yaw_angle);
  } //End MPU newdata

  /**************************************************/
    
}

Which is testing everything. Let's see if this code does run
This means the main-processor is not an ESP8266
On this board the ESP8266 is only used as a WiFi-transmitter.
The ESP8266-board is running a AT-firmware. This means everything about WiFi must be done by AT-commands

One idea what could be the problem is incompatibility between the Camera-slider-code and the actual ESP8266 core if you installed the ESP8266-board-support this year.

Thank you very much.

That is actually extremely helpful and I'm now questioning why their support team didn't bother to send me that test code as this has been going on since early April.

More importantly it clearly highlights an error on the wifi module. I read this to be a hardware error but if you have any other thoughts then please do let me know as I'll now take this read-out back to them.

I don't know about AT-commands but could this be a firmware issue and is that relatively easy to update?

C:\Users\Admin\Downloads\M0_Board_test_devia_2_with_loops_for_AUX_output\IMU.ino:117:0: warning: "MPU6050_AUX_VDDIO" redefined

 #define MPU6050_AUX_VDDIO MPU6050_D7  // I2C high: 1=VDD, 0=VLOGIC

 

C:\Users\Admin\Downloads\M0_Board_test_devia_2_with_loops_for_AUX_output\IMU.ino:13:0: note: this is the location of the previous definition

 #define MPU6050_AUX_VDDIO          0x01   // R/W

 

C:\Users\Admin\Downloads\M0_Board_test_devia_2_with_loops_for_AUX_output\IMU.ino:360:0: warning: "MPU6050_FIFO_EN" redefined

 #define MPU6050_FIFO_EN        MPU6050_D6

 

C:\Users\Admin\Downloads\M0_Board_test_devia_2_with_loops_for_AUX_output\IMU.ino:24:0: note: this is the location of the previous definition

 #define MPU6050_FIFO_EN            0x23   // R/W

 

C:\Users\Admin\Downloads\M0_Board_test_devia_2_with_loops_for_AUX_output\M0_Board_test_devia_2_with_loops_for_AUX_output.ino: In function 'void setup()':

C:\Users\Admin\Downloads\M0_Board_test_devia_2_with_loops_for_AUX_output\M0_Board_test_devia_2_with_loops_for_AUX_output.ino:152:45: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

   wifi_status = ESPsendCommand("AT", "OK", 1);

                                             ^

C:\Users\Admin\Downloads\M0_Board_test_devia_2_with_loops_for_AUX_output\M0_Board_test_devia_2_with_loops_for_AUX_output.ino:155:35: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

   ESPsendCommand("AT+GMR", "OK", 5);

                                   ^

C:\Users\Admin\Downloads\M0_Board_test_devia_2_with_loops_for_AUX_output\M0_Board_test_devia_2_with_loops_for_AUX_output.ino:158:40: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

   ESPsendCommand("AT+CWMODE=2", "OK", 3); // Soft AP mode

                                        ^

C:\Users\Admin\Downloads\M0_Board_test_devia_2_with_loops_for_AUX_output\M0_Board_test_devia_2_with_loops_for_AUX_output.ino:160:16: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

   char *cmd =  "AT+CWSAP=\"JJROBOTS_TEST\",\"87654321\",5,3";

                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\Admin\Downloads\M0_Board_test_devia_2_with_loops_for_AUX_output\IMU.ino: At global scope:

C:\Users\Admin\Downloads\M0_Board_test_devia_2_with_loops_for_AUX_output\IMU.ino:441:1: warning: 'typedef' was ignored in this declaration

 typedef union accel_t_gyro_union

 ^~~~~~~

Sketch uses 29752 bytes (11%) of program storage space. Maximum is 262144 bytes.
Global variables use 3704 bytes of dynamic memory.
Atmel SMART device 0x10010005 found
Device       : ATSAMD21G18A
Chip ID      : 10010005
Version      : v2.0 [Arduino:XYZ] Dec 20 2016 15:36:39
Address      : 8192
Pages        : 3968
Page Size    : 64 bytes
Total Size   : 248KB
Planes       : 1
Lock Regions : 16
Locked       : none
Security     : false
Boot Flash   : true
BOD          : true
BOR          : true
Arduino      : FAST_CHIP_ERASE
Arduino      : FAST_MULTI_PAGE_WRITE
Arduino      : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
done in 0.814 seconds

Write 29752 bytes to flash (465 pages)

[====                          ] 13% (64/465 pages)
[========                      ] 27% (128/465 pages)
[============                  ] 41% (192/465 pages)
[================              ] 55% (256/465 pages)
[====================          ] 68% (320/465 pages)
[========================      ] 82% (384/465 pages)
[============================  ] 96% (448/465 pages)
[==============================] 100% (465/465 pages)
done in 0.238 seconds

Verify 29752 bytes of flash with checksum.
Verify successful
done in 0.027 seconds
CPU reset.

Monitor output


JJROBOTS DEVIA BOARD TEST CODE v1.0

SWITCH Not Pressed
TEST:  LEDS...
TEST: Checking IMU...
  WHO_AM_I : 11, error = 0
TEST: WIFI. Generating network JJROBOTS_TEST
!Timeout!
!Timeout!
!Timeout!
!Timeout!
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE


The report says timeout. Of course this can be a hardware-issue.
A second possability is software incompatibility between the AT-firmware that is running on the ESP8266-module and the commands sended on serial1

The code testcode like posted above sets the baudrate to 115200.

  SerialUSB.begin(115200); // Serial output to console
  Serial1.begin(115200);
  SerialUSB.println("Init...");

Here
https://learn.sparkfun.com/tutorials/esp8266-wifi-shield-hookup-guide/at-firmware-overview
espressif says the default baudrate is 9600

So you could change the baudrate to 9600

SerialUSB.begin(115200); // Serial output to console
  Serial1.begin(9600);
  SerialUSB.println("Init...");

and give this a try

on booting the ESP8266 uses 74880 baud for sending basic information
So give 74880 baud a try too

SerialUSB.begin(115200); // Serial output to console
  Serial1.begin(74880);
  SerialUSB.println("Init...");

best regards Stefan

Sadly, both of those rates gave the same output.

JJROBOTS DEVIA BOARD TEST CODE v1.0

SWITCH Not Pressed
TEST:  LEDS...
TEST: Checking IMU...
  WHO_AM_I : 11, error = 0
TEST: WIFI. Generating network JJROBOTS_TEST
!Timeout!
!Timeout!
!Timeout!
!Timeout!
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE
!! ERROR ON WIFI MODULE

The board I've been testing was a replacement, so I also fetched the original board they sent me and have ran the same tests and I get exactly the same results so perhaps a faulty batch or components or assembly.

Time to push the supplier for a resolution now I have more evidence.

Thank you.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.