Sony's Developer World forum

    • Home
    • Forum guidelines

    Upcoming maintenance 

     

    Dear Customers and Partners.

    This website will be undergoing scheduled maintenance on June 14, 2023. Please be aware there may be disruption to the developer portal website and associated services during the scheduled maintenance period.

    This upgrade is essential to ensure the continued performance, reliability, and security of Developer World.

    We apologize for any inconvenience.

     

     

    WiFi Add board: Connection Problem

    Spresense
    5
    48
    8071
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jp04 @jp04 last edited by

      @jp04 said in WiFi Add board: Connection Problem:

      Hi. I am having problems connecting the Spresense main board to the wifi network. I don't know why when I use function App_InitModule() the following message appears all the time in the serial monitor "GS2200 responds Zero data length" and it doesn't execute beyond that line of the void setup function. According to the examples available in the library, that function is executed in the void setup, so it never finishes executing everything it contains. What can I do to solve this problem? Thanks in advanced for the help.

      Screen Shot 2023-01-04 at 14.03.08.png

      I kept checking the code and it seems that the error is in the different functions related to the AT commands. It seems that no response is obtained from the AT commands and this is the reason why the execution of the code does not progress. What can I do?

      1 Reply Last reply Reply Quote
      • J
        jp04 last edited by

        @jp04 said in WiFi Add board: Connection Problem:

        @jp04 said in WiFi Add board: Connection Problem:

        Hi. I am having problems connecting the Spresense main board to the wifi network. I don't know why when I use function App_InitModule() the following message appears all the time in the serial monitor "GS2200 responds Zero data length" and it doesn't execute beyond that line of the void setup function. According to the examples available in the library, that function is executed in the void setup, so it never finishes executing everything it contains. What can I do to solve this problem? Thanks in advanced for the help.

        Screen Shot 2023-01-04 at 14.03.08.png

        I kept checking the code and it seems that the error is in the different functions related to the AT commands. It seems that no response is obtained from the AT commands and this is the reason why the execution of the code does not progress. What can I do?

        I think the problem is related with the AT commands. When I enter them (for example: AT) nothing appears on the serial monitor screen. Already uploaded the firmware but still dont have any answer. Any ideas?

        C 1 Reply Last reply Reply Quote
        • C
          CamilaSouza DeveloperWorld @jp04 last edited by

          Hi @jp04

          Which Add on board are you using?

          I assume you are using this library: https://github.com/jittermaster/GS2200-WiFi
          Which example are you trying to run?

          1 Reply Last reply Reply Quote
          • J
            jp04 last edited by

            Hi @CamilaSouza. Thanks for your reply. Yes, as you said, I am using the library: https://github.com/jittermaster/GS2200-WiFi

            Regarding the example, at the moment I am only testing if I can establish the wi-fi connection, so I am not using a complete example as such. I Took the MQTTPublish.ino example code as a base. I am using the following code, where I use the LEDs to validate if the initialization of the module and the connection have been established, but only the first two LEDs light up.

            Screen Shot 2023-01-11 at 14.08.31.png

            The serial monitor displays the following:

            Screen Shot 2023-01-11 at 14.16.07.png

            Thanks for your help

            C 2 Replies Last reply Reply Quote
            • C
              CamilaSouza DeveloperWorld @jp04 last edited by

              Hey, @jp04

              Let me do some investigating on my side and see if I'm able to use the WiFi Add on board.
              BRB.

              1 Reply Last reply Reply Quote
              • C
                CamilaSouza DeveloperWorld @jp04 last edited by CamilaSouza

                Hey, @jp04
                App_InitModule() worked for me.
                This was my output:

                GS2200 is ready to go.
                
                Serial2WiFi APP
                GS Response: 12
                Normal Boot.
                
                >AT
                
                AT
                
                OK
                GS Response: 1
                >ATE0
                
                
                
                ATE0
                
                OK
                GS Response: 1
                >AT+WREGDOMAIN=?
                
                
                REG_DOMAIN=TELEC 
                
                OK
                GS Response: 1
                >AT+NMAC=?
                
                
                3c:95:09:00:8b:a9
                OK
                GS Response: 1
                >AT+VER=??
                
                
                S2W APP VERSION=5.7.1
                S2W GEPS VERSION=5.7.1
                S2W WLAN VERSION=5.7.1
                S2W BIN TYPE=GS2K_BUILDER_26691
                S2W RELEASE TYPE=GA
                BUILD TIME=13:14:24
                BUILD DATE=Feb  6 2019
                WLAN EXT VERSION=1
                S2W APP EXT VERSION=1
                WLAN FEAT BMAP=0000000000000317
                GEPS EXT VERSION=1
                FLASH ID=0x000020c2:MICRONIX-4MB
                OK
                GS Response: 1
                >AT+WRXACTIVE=0
                
                
                OK
                GS Response: 1
                >AT+WRXPS=1
                
                
                OK
                GS Response: 1
                >AT+BDATA=1
                
                
                OK
                GS Response: 1
                Okay
                
                

                And this was the code I tested:

                #include <GS2200Hal.h>
                #include <GS2200AtCmd.h>
                #include "AppFunc.h"
                
                
                #define  CONSOLE_BAUDRATE  115200
                
                // the setup function runs once when you press reset or power the board
                void setup() {
                
                	/* initialize digital pin LED_BUILTIN as an output. */
                	pinMode(LED0, OUTPUT);
                	digitalWrite( LED0, LOW );   // turn the LED off (LOW is the voltage level)
                	Serial.begin( CONSOLE_BAUDRATE ); // talk to PC
                
                	/* Initialize SPI access of GS2200 */
                	Init_GS2200_SPI();
                
                	digitalWrite( LED0, HIGH ); // turn on LED
                
                	/* Initialize AT Command Library Buffer */
                	AtCmd_Init();
                
                	/* GS2200 Association to AP */
                	App_InitModule();
                  Serial.println("Okay");
                }
                
                
                // the loop function runs over and over again forever
                void loop() {
                
                }
                

                Let's try and figure out what is different from out setups.
                First would be connection. Could you take a picture of your board + Wifi Add on so we can check connection?
                Also.. what is the version of the Arduino IDE you're using?
                Are you using just main board or any extension board?

                UPDATE!
                I got your error when I put a jumper between pin 1 and 2 of JP10 on the extension board.
                Did you do this by any chance?

                J 1 Reply Last reply Reply Quote
                • J
                  jp04 @CamilaSouza last edited by

                  Hi @CamilaSouza. Thank you for your reply. I already solved the problem. It was related with the wi-fi board version. I had to modify the files GS2200Hal.cpp and GS2200Hal.h in order to be able to recognise the type of the board i am using. Now i am facing problems regarding the AT commands, for some of them i got an answer for the module but for others i go INVALID INPUT as an answer. I dont know how to correctly implement MQTT protocol over SSL and there is no an example on the library of this module regarding this topic. I am clueless right now.

                  C M 2 Replies Last reply Reply Quote
                  • C
                    CamilaSouza DeveloperWorld @jp04 last edited by

                    Hi, @jp04

                    Might have found the answer 😄
                    Take a look at the back of your board.
                    Is there a red dot or a yellow dot?

                    Red dot:
                    b4b5c248-8920-481d-81d0-caeb4e58d115-image.png

                    Yellow dot:
                    981d9308-9cf1-4130-a120-9134033420ab-image.png

                    J 1 Reply Last reply Reply Quote
                    • J
                      jp04 @CamilaSouza last edited by

                      @CamilaSouza Hi. Thank you for your support. Already checked that. But now the main problem is how to upload the certificates related to SSL connections by using AT command. I even contacted the manufacturer of the wifi board but they told me that the support of that board had already ended.

                      C 2 Replies Last reply Reply Quote
                      • C
                        CamilaSouza DeveloperWorld @jp04 last edited by

                        @jp04

                        Oh, so you already saw the code patches in this website:
                        https://idy-design.com/product/is110b.html

                        I'm sorry you got no support from the manufacturer. I'm investigating internally what to do about this situation.

                        I've tagged in another topic where a user is trying to achieve the same thing, but with a different wifi board.
                        I thought you two might benefit from getting in touch since your projects might have similar components.

                        1 Reply Last reply Reply Quote
                        • C
                          CamilaSouza DeveloperWorld @jp04 last edited by

                          Hi, @jp04

                          I'm investigating the issue with the lack of support for the Wi-Fi add on board. Let me ask you a follow-up question.
                          About the manufacturer you contacted, was it the board manufacturer or the GS2200M module manufacturer?

                          Which company did you talk to?

                          1 Reply Last reply Reply Quote
                          • J
                            jp04 last edited by

                            @CamilaSouza Hi. Thanks for keep helping me with this topic. Yes, I contacted the GS2200M module manufacturer (Telit) and they asked me to contact the supplier (IDY) instead.

                            C 1 Reply Last reply Reply Quote
                            • C
                              CamilaSouza DeveloperWorld @jp04 last edited by

                              @jp04

                              I'm trying to contact IDY to see if they have any answers.
                              I'll let you know if they answer me.

                              J 1 Reply Last reply Reply Quote
                              • J
                                jp04 @CamilaSouza last edited by

                                @CamilaSouza Hi. I was thinking in load the certificates in a SD Card for the SSL connection. Do you know is there a compatible SD card module that I can use instead of the SPRESENSE extension board ?

                                J C 2 Replies Last reply Reply Quote
                                • J
                                  jens6151 0 1 1 @jp04 last edited by

                                  @jp04 Do you use the SD Card only for the certificates?
                                  It would be much easier to use the internal flash at "/mnt/spif/...". I had them on SD card too in the beginning but I copied them to the flash memory.
                                  Only if you want to replace the certificates, a SD Card is convenient.

                                  J 1 Reply Last reply Reply Quote
                                  • C
                                    CamilaSouza DeveloperWorld @jp04 last edited by

                                    @jp04

                                    In case you really prefer to use the SD card:

                                    We don't have any official SD card reader that has been tested and approved by our engineers to give as a recommendation.
                                    But you can try something like this:
                                    https://www.elfa.se/en/microsd-card-breakout-board-adafruit-254/p/30091189

                                    A microSD breakout that you can communicate via SPI.

                                    1 Reply Last reply Reply Quote
                                    • J
                                      jp04 @jens6151 0 1 1 last edited by

                                      @jens6151-0-1-1 Hi. Thanks for your reply. Can you show me on your code how did you do that? Do i just have to save them in that path? How can I read them? I am sorry if this questions sounds silly but I a little lost on how accomplish this.

                                      J 1 Reply Last reply Reply Quote
                                      • J
                                        jens6151 0 1 1 @jp04 last edited by

                                        @jp04
                                        Actually I copied it to SD card and used then the copy command (cp) of nsh (NuttX Shell).

                                        As you do not have an SD card I would recommend this sample to download to SPI flash.

                                        1. Replace SRC_start and SRC_size with your certificate.
                                        2. Manipulate DSP_MOUNTPT_SPIFLASH with the path to copy it to and dsplist with the file name.
                                        3. Flash and start the script. Choose SPI-Flash

                                        Accessing the data is a simple read using open(...) from stdio.h or you use the File library.
                                        See the File library here.

                                        Hint:
                                        Do not use

                                        int File::read() ;
                                        

                                        but

                                        int File::read(void *buf, size_t nbyte) ;
                                        

                                        It will be 100x faster.

                                        J 1 Reply Last reply Reply Quote
                                        • J
                                          jp04 @jens6151 0 1 1 last edited by

                                          @jens6151-0-1-1 Hi. I am sorry for keep bothering. I tested the following code:

                                          #include <stdio.h>
                                          #include <sys/stat.h>
                                          #include <unistd.h>
                                          
                                          // Include each file generated by bin2c
                                          #include "SRC.h"
                                          
                                          #define DSP_MOUNTPT_SPIFLASH "/mnt/spif/BIN"
                                          
                                          #define _FILEELEM(elem) { \
                                            .name = #elem, \
                                            .addr = elem##_start, \
                                            .size = &elem##_size, \
                                          }
                                          
                                          struct fileinfo_s {
                                            const char *name;
                                            const unsigned char *addr;
                                            const size_t *size;
                                          };
                                          
                                          struct fileinfo_s dsplist[] =
                                          {
                                            // Add each file here
                                            _FILEELEM(SRC),
                                          };
                                          
                                          void setup() {
                                            // put your setup code here, to run once:
                                            unsigned int i;
                                            int ret;
                                            FILE *fp;
                                            char dirpath[64] = {0};
                                            char filepath[64] = {0};
                                          
                                            Serial.begin(115200);
                                          
                                            Serial.println("SPI-Flash");
                                            strncpy(dirpath, DSP_MOUNTPT_SPIFLASH, sizeof(dirpath));
                                          
                                            mkdir(dirpath, 0777);
                                          
                                            for (i = 0; i < sizeof(dsplist) / sizeof(dsplist[0]); i++)
                                              {
                                                snprintf(filepath, sizeof(filepath), "%s/%s",
                                                         dirpath, dsplist[i].name);
                                          
                                                Serial.print("Install: ");
                                                Serial.print(filepath);
                                          
                                                unlink(filepath);
                                          
                                                fp = fopen(filepath, "wb");
                                          
                                                ret = fwrite(dsplist[i].addr, *dsplist[i].size, 1, fp);
                                          
                                                Serial.println((ret) ? " Done." : " Fail.");
                                          
                                                fclose(fp);
                                              }
                                          

                                          and got the following answer:

                                          17:09:13.834 -> SPI-Flash
                                          17:09:13.834 -> Install: /mnt/spif/BIN/SRC Done.
                                          

                                          I would like to know if there is a way to list all the files located at /mnt/spif/BIN. Thanks a lot for all your help.

                                          J 1 Reply Last reply Reply Quote
                                          • C
                                            CamilaSouza DeveloperWorld last edited by

                                            @jp04

                                            Update on support for WiFi Add on Board iS110B:

                                            I contacted IDY and was told the support for this board was handed to Restar Electronics Corporation.
                                            https://www.restar-ele.com/

                                            I sent them a message asking for support on the issue of uploading SSL certificates to the board.
                                            Will keep you posted on the issue.

                                            J 1 Reply Last reply Reply Quote
                                            • First post
                                              Last post
                                            Developer World
                                            Copyright © 2021 Sony Group Corporation. All rights reserved.
                                            • Contact us
                                            • Legal