okrasolar / Cicada

IoT Communications Module for Energy Access. An easy way to get production ready, bi-directional communications for your IoT embedded device. Proiect supported by the EnAccess Foundation - https://enaccess.org
https://enaccess.org
MIT License
5 stars 2 forks source link

Trouble communicating with Cicada via serial #2

Open Jaribeau opened 4 years ago

Jaribeau commented 4 years ago

Hey! I've been playing with the Cicada (2g v1.2) (thanks to the Okra guys in Phnom Penh for hooking us up!) - and have been struggling to get any proper response from my AT commands to it.

                                                                                              T      *T      T       ¥
                                                                                                                                                                                         T&┴       ┌
         T      :U!MT6261,1418B08SIM800C24_BTUU!␊SDC_T␋└␊O┤├H▒┼␍┌␊⎼UM␊
                                                                      Z>L1⎽␋└_R␊⎽␊├_A┌┌=>␊│⎻␊␌├┴⎺┌├:4,*⎼␊⎽┤┌├┴⎺┌├:0,┬▒⎼└:0,▒⎻⎻:0,IF:0▒┌U%␊
                                                                                                                                          IMEI:861230047519380U1␊
                                                                                                                                                                 "RL =1, GEA = 0│70, SM =1, PFC = 1!7U5␊
             (MS GPRS = 1, └┤┌├␋⎽┌⎺├ =12, ␊│├ ␍≤┼ = 1U1␊!$[SIM_DRV] 10 : °°°°°°°°, 0, 0, 0, 0^T U'
                                                                                                  @
                                                                                                   U'&
                                                                                                      @%
                                                                                                        U)

or if I'm running the serial_linux example:

Sending command: AT+cpin?
10 bytes written
31 bytes received
Received message: w�ӥ

Sending command: AT+cpin?
10 bytes written
31 bytes received
Received message: $
 �

What I've tried:

I'm hoping it's something simple that I'm overlooking. If you have any suggestions on what to try would be wonderfully appreciated.

I'm out for an hour or two, but then I'm going to try from a linux machine, and hopefully an ESP if I can get my hands on one today.

lippit commented 4 years ago

Hey, is there some other process trying to communicate with the modem at the same time? On Linux, there is "ModemManager", which tries to connect the modem automatically, and always spams the serial line with garbage. You need to turn it off in order to access it properly. I assume there is something similar on Mac.

Jaribeau commented 4 years ago

No luck so far - I didn't have much luck tracking down the ModemManager equivalent in MacOS, and was having some trouble getting it to compile on linux (some c++ version issues). I decided to setup an ESP32 as a serial bridge to try to just get some barebones OKs in response to my ATs. After quite a bit of trying I've not managed that either.

Here's my setup on that:

The module is connected to the network fine (LED changes to slow blink shortly after powering up) - but then sending AT commands is met with a nice stream of these reversed question marks ⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮. I tested with another device to confirm that my serial messages are getting properly relayed along. I'm trying to talk with it at 9600 baud, but have tested all standard rates to see if that was the issue.

The LED switching to a slow blink leads me to believe that I haven't destroyed the SIMCOM chip while testing, and I know serial messages are at least being sent properly.

So I imagine I've got the Cicada wired up incorrectly, or my serial configuration is bad.

lippit commented 4 years ago

Yeah, sounds like some hardware issue to me. I used a dev board from Simcom when developing this, which had a USB<->UART bridge included. You definitely need a serial bridge, the onboard USB connector on the Cicada board is only for firmware updates.

The default baud rate is 115200. For power, the Cicada needs booth 3.3V and 5V, that should be ok when you connect a power supply and the 3.3V from the ESP. Logic levels are 3.3V, that should also be ok with an ESP32 UART bridge.

I'll also ask my colleagues from the hardware team, probably they have an idea.

Jaribeau commented 4 years ago

the onboard USB connector on the Cicada board is only for firmware updates. Good to know 👍

Thanks for the help - let me know if any of the others have suggestions.

xl0 commented 4 years ago

Heya. Sorry for the late reply.

Do you have a multimeter? Would you be able to check the voltage on the Cicada power supply?

image

It should be 4.05v.

Please double-check continuity on all wires, including 3.3v and GND.

If you power Cicada from the host interface, you need to set the POWER line high, but it's always on when powering from USB, which seems to be the case, and you are getting the blinking.

Otherwise, it looks like you are doing things correctly. I'll see if we can send you another one, plus an STM32 dev board with a known to work USB-UART interface on it.

xl0 commented 4 years ago

Heya.

Thinking about it, we did not update the documentation regarding the host connector!

image

Which means, all the pin numbers are shifted! The new Cicada will have it labelled more clearly:

image

I'll upload it to public git as soon as it passes our internal review, and make sure to update the README too. Was this the issue?

Jaribeau commented 4 years ago

That was indeed the issue, thanks!