Arduino with xbee shield + mDot

I’m doing the same thing with the same devices. I can’t receive the ‘OK’ on the Serial monitor, when sending ‘AT’. I want to know where is the problem and how did you success. I’m looking for your reply.

I use an Arduino Uno with XBee and mdot. I connect them together, but I can’t receive the ‘OK’ on the Serial monitor, when sending ‘AT’. What should I do first? I wonder whether I miss some step.

Here I see you help everyone. I use the same devices as theirs, and I have the same problem. As you told them did, I did. But it didn’t work. I hope I can get help from them. How can I get his email as you did on the second floor. My email is yu.han2@jcu.edu.au. Thanks.

@yurbaggio
Hi, my experience with Arduino Uno was not great.
Basically you have to use Software Serial to talk to the mdot, because Uno has only on serial.
I had much better experience with Arduino Leonardo as it has additional HW Serial.

In your case make sure you have set the correct baud rate - the default is 115200 on the mdot.
I would suggest - reduce the baud rate on the mdot - connect it via the mtech dev board and change it to something lower as the Software Serail library does not support 115200 or at least not reliably.

Then you have to use the Software Serial Port to talk to the mdot board and you can listen with the Monitor on the default HW Serial port for some output.

I’ve got a mDot connected to TTN with an Arduino Uno, however I need the addition resources available from the Arduino Mega. When I tried porting the Uno code over and removing the software serial library, I no longer see any serial data in the serial monitor. Any thoughts?

a code error ?

My code for the mDot using an xBee shield and an Arduino Mega is the following:
//
void setup()
{
Serial.begin(9600); //configure serial port
Delay(1000); // 1 second delay to allow mDot to boot
Serial.send(AT+JOIN); //OTA to join TTN
Delay(500);
Serial.read(); //read response message from mDot
}

void loop()
{
if (Serial.available())
{
Serial.send(AT+SEND = Hello World); // Command data send to mDot
Delay(500);
Serial.read(); // read response message from mDot
Delay(500);
}
else
{
Serial.println(“error”);
}
}
//

Note that I have already configured the mDot previously to have a baud rate of 9600 along with the App EUI and App Key.

Would you be able to share your Mega code for the mDot? I had it working on the Uno but and struggling getting it on the Mega for some reason.

Hi Andy.

It is probably too late now - I’ve been very busy last two weeks and wasn’t looking at the forums.
Anyway - you could try this library:

Have in mind the default baud rate for the mDot is 115200 and unless you have changed it you should use that.

The Arduino Mega has three additional serial ports: Serial1 on pins 19 (RX) and 18 (TX), Serial2 on pins 17 (RX) and 16 (TX), Serial3 on pins 15 (RX) and 14 (TX). So be sure you have connected your xbee shield to the correct serial - e.g. Serial1.

Without the library you could do something like that:
Assuming you have connected to Serial1 and you have kept the default baud rate:
void join() {
Serial.println(“join”);
// wake up
Serial1.println(“AT”);
// use factory defaults
Serial1.println(“AT&F”);
// public network mode
Serial1.println(“AT+PN=1”);
// network join OTAA
Serial1.println(“AT+NJM=1”);
// set AppEUI
Serial1.println(“AT+NI=0,” + appEui);
// set AppKey
Serial1.println(“AT+NK=0,” + appKey);
// application data port
Serial1.println(“AT+AP=2”);
// join
Serial1.println(“AT+JOIN”);
}

void send(String msg) {
Serial.println(“send”);
// send data
Serial1.println(“AT+SEND=” + msg);
}

void setup() {
Serial1.begin(115200);
join();
}

Sorry for the late answer.
Cheers,
Ivan

Also check if you have properly connected TX from the xbee shield to RX on the mega and RX to TX respectively.

Not sure if anyone will reply to this but I have been following this thread and still coming up short.

I am trying to configure an mdot chip to work with an arduino mega through an xbee shield. I think it has something to do with the way I have my serial pins set up as the shield I am using does not actually connect to the serial1 ports on the mega.

I have tried various setups including running wires straight from the board to the mdot without using the shield but still have not been able to receive any output when entering commands through the serial monitor.

Any tips would be appreciated as I am very new to this