Community
cancel
Showing results for 
Search instead for 
Did you mean: 
KKhoi
Beginner
2,464 Views

Problems when connect 3G shield with Intel Edison

HI

I attach my Intel Edison to 3G shield design by cooking-hacks,I write code on Arduino IDE to send AT command to Serial 1(I have set the baud rate of ttyMFD1 is 115200),On Yocto,I type: "cat /dev/ttyMFD1" to receive data . But the data only response some weird character like this:

Does anyone can help me?

Message was edited by: Khoi Nguyen Quang

0 Kudos
17 Replies
idata
Community Manager
78 Views

Hi Khoi,

 

 

We understand you are having issues with serial communication, in order to help you we would like to know some more information:
  • Could you please tell us which specific 3G shield you are using?
  • Could you share us the configuration you set up?
Regards,

 

 

-Yermi

 

KKhoi
Beginner
78 Views

-I am using 3G shield SIM 5215E edition (https://www.cooking-hacks.com/documentation/tutorials/3g-gps-shield-arduino-raspberry-pi-tutorial/ 3G/GPRS shield over Arduino and Raspberry Pi )

-This is my configuration

And this is my code

Also,thanks for your help

idata
Community Manager
78 Views

Hi,

 

 

Thanks for the pictures and for specifying which 3G shield you are using.

 

 

I would like to know if you set up these instructions in your 3G shield:
  1. Place the serial communication jumper in the right position
  2. Place power jumper in the right position
Also, could you share with us the code you are using? I know you share it in the picture but I can't see all the code.

 

We'll be waiting for your reply.

 

 

Regards,

 

 

Yermi

 

KKhoi
Beginner
78 Views

Hi

I have configured the jumper correctly by following this tutorial https://www.cooking-hacks.com/forum/viewtopic.php?f=43&t=5946&sid=d4e100ac8a18a1a3417d985a5287f426 https://www.cooking-hacks.com/forum/viewtopic.php?f=43&t=5946&sid=d4e100ac8a18a1a3417d985a5287f426

This is my my full code if you need:

void setup(){

Serial.begin(115200);

Serial1.begin(115200);

Serial.println("Starting...");

}

void loop(){

Serial1.println("AT+CMGI");

delay(5000);

Serial1.println("ATI");

delay(5000);

Serial1.println("AT+CSQ");

}

idata
Community Manager
78 Views

Hi Khoi,

 

 

Thanks for sharing your code.

 

 

I would like to know if you have tested this 3G shield with the Arduino board, is this the case? I would like to know what results you are getting, are they similar to the ones from the Edison? Additionally, could you try with different baud rates?

 

 

Regards,

 

-Yermi

 

idata
Community Manager
78 Views

Hi Khoi,

 

 

I would like to know if you have any updates or questions. Just let me know and I'll try to help.

 

 

Regards,

 

-Yermi

 

KKhoi
Beginner
78 Views

HI

I have discovered that although the response is hard to see but the AT command still sending normally , so that I have succeed in operate an HTTP session without caring about them , But now I have another problem: My health sensor shield and my 3G shield(designed by cooking hacks) both use UART poron Edison(/dev/ttyMFD1) so that they can not work simultaneously . Do you have any advice for me in this situation?

idata
Community Manager
78 Views

Hi Khoi,

 

 

I'm happy that you were able to send the AT command and operate an HTTP session successfully. As an advice, maybe you can use I2C communication.

 

 

I was looking for information related to I2C pins in your 3G shield and I found that the 3G shield version 2 (SIM5218 and SIM5215) contains an I2C interface in these pins, pin 47 SDA and pin 46 SCL (70 pins connector SIM5218E), you can verify and find more details in the hardware design document (http://www.cooking-hacks.com/skin/frontend/default/cooking/pdf/V-SIM5218E_HD_V1.04.pdf http://www.cooking-hacks.com/skin/frontend/default/cooking/pdf/V-SIM5218E_HD_V1.04.pdf). However, I didn't find pin descriptions for the shield, so I'm not sure which pins correspond to SDA and SCL, do you have this information?

 

 

On the other hand, in the Edison Arduino board, we need to use the I2C_6_ for connecting devices to I2C communication (A4/A5 – analog headers and SDA/SCL – digital header), so I suggest you to configure I2C connection following the instructions in the http://www.intel.com/content/dam/support/us/en/documents/edison/sb/edisonarduino_hg_331191007.pdf Hardware Guide of Intel® Edison kit for Arduino exactly as they are (page 29), then, in order to detect your device please use this command i2cdetect -y -r 6, if your 3G shield is detected will be shown there.

 

 

Hope this information helps.

 

 

Regards,

 

-Yermi

 

idata
Community Manager
78 Views

Hi Khoi,

 

 

Were you able to detect your 3G shield using I2C? Could you use your shields simultaneously?

 

If you have any questions or need more assistance, let me know, please.

 

 

Regards,

 

-Yermi
KKhoi
Beginner
78 Views

Hi

I have research by far and found that my 3G shield couldn't connect I2C for some reason. So that I decided to use UART 2 . I have followed this thread and use "systemctl stop serial-getty@ttyMFD2.service" on SSH to disable UART 2 to console and plug my 3G shield into UART 2 . But after that I can't SSH through wifi anymore(I need SSH to write Linux command because UART 2 port is now used to connect to 3g shield).

At first when I connect both cable and connect Edison to Wifi , It seems fine

When I disconnect the serial cable(device mode cable still connect) then the Edison doesn't connect to wifi and I can't SSH anymore

Best regards

idata
Community Manager
78 Views

Hi Khoi,

 

 

I would like to know how you are connecting the 3G shield to the UART 2, also, after you run systemctl stop serial-getty@ttyMFD2.service, have you tested your communication with ttyMFD2? Please look at this guide: <</span> https://github.com/humberto-garza/Edison-Getting-Started>, in the section "Interact with Serial 2" in order to test the communication before connecting the 3G shield. Let me know if you have any issues.

 

 

Regards,

 

-Yermi

 

KKhoi
Beginner
78 Views

I connect the shield to UART 2 by picture below

I use 5V to provide power for my shield and now I can SSH now

Also , I have followed the thread , test the communication and set the baud rate to 115200 , It works too.

The only thing is, is there any way to use Serial 2 in Arduino IDE , I have changed my old sketch(replace Serial1-->Serial2) and upload it but nothing happen in the cat /dev/ttyMFD2. Do I need to use any library in Arduino IDE to control Serial 2?(I have tried mraa but it don't work on Arduino IDE)

Here is the sketch I uploaded

void setup(){

Serial.begin(115200);

Serial2.begin(115200);

Serial.println("Starting...");

}

void loop(){

Serial2.println("AT+CMGI");

delay(5000);

Serial2.println("ATI");

delay(5000);

Serial2.println("AT+CSQ");

}

idata
Community Manager
78 Views

Hi Khoi,

 

 

You're right! Mraa can't be used in the Arduino IDE.

 

 

Moreover, I've been able to use Serial 2 in the Arduino IDE, the Serial2 is actually the Linux Serial Terminal, so in order to use it you need to disable the Linux Serial Terminal. Please look at the following steps:
  1. Connect the Edison through SSH and COM in 2 Putty sessions
  2. Disable the serial terminal in the COM session typing these commands in the SSH session:

systemctl stop serial-getty@ttyMFD2.service

dmesg -n 1

 

Then I ran the following sketch:

void setup() {

// put your setup code here, to run once:

Serial2.begin(115200);

Serial2.println("hola World!!!");

}

And this is my result:

 

 

Hope this information helps, let me know if you have any questions.

Regards,

 

-Yermi
idata
Community Manager
78 Views

Hi Khoi,

 

 

I would like to know if you were able to run your sketch using serial 2. However, please let me know if you need more help.

 

 

Regards,

 

-Yermi

 

KKhoi
Beginner
78 Views

Hi

Sorry for my late reply.I have tried to connect my 3G board to Intel Edison through UART 2 as you guide

I have use mraa lib to write AT command to my 3G board and tried to read and write the data has been written.But after I use "mraa_uart_write(uart, buffer, sizeof(buffer));"(buffer is a char of my command) then I use "mraa_uart_data_available" It doesn't seem to have any data available

Any advice?

Best regard

idata
Community Manager
78 Views

Hi Khoi,

 

 

Don't worry, I'm here to help you. Could you please share your code using mraa?

 

 

Regards,

 

-Yermi

 

idata
Community Manager
78 Views

Hi Khoi,

 

 

I would like to know if you have any update about your issue. Do you still have issues using 3G shield?

 

 

Regards,

 

-Yermi