Announcement

Collapse
No announcement yet.

Problem connecting gen4-iod-24t to ws4

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem connecting gen4-iod-24t to ws4

    Hi
    I'e purchased a gen4-iod-24t module, and i'm trrying to operate with it.
    I've installed ws4 and arduino IDE and configured properly the board as requested on the gen4-iod-24t datasheet.
    I've also installed the driver for the gen4 programmer from sillabs site.
    But in the comm tab of ws4 (with port number properly selected) i've always the message "Device is not responding".
    When i make a port scan i see the led on gen 4 programmer and the display backlight flashing.
    I've tried to compile and load a form with a simple text and also an example (coolgaugeiod) and the result in the box is:


    Compiling....
    Looking for library 'user32'
    Adding paths from jna.library.path: null
    Trying user32.dll
    Found library 'user32' at user32.dll
    DPI detection failed, fallback to 96 dpi
    Looking for library 'shell32'
    Adding paths from jna.library.path: null
    Trying shell32.dll
    Found library 'shell32' at shell32.dll
    Looking for library 'Ole32'
    Adding paths from jna.library.path: null
    Trying Ole32.dll
    Found library 'Ole32' at Ole32.dll
    Sto caricando la configurazione...
    Sto inizializzando i pacchetti...
    Sto preparando le schede...
    Sto verificando...
    Archiving built core (caching) in: C:\Users\Meliconi\AppData\Local\Temp\arduino_cache_205980\core\core_esp8266_esp8266_gen4iod_CpuFrequ ency_160,UploadSpeed_115200_a0d629d2ffca439ffd98b762907c7caf.a
    Lo sketch usa 245321 byte (56%) dello spazio disponibile per i programmi. Il massimo è 434160 byte.
    Le variabili globali usano 40272 byte (49%) di memoria dinamica, lasciando altri 41648 byte liberi per le variabili locali. Il massimo è 81920 byte.
    Sto caricando...
    Uploading 249472 bytes from C:\Users\Meliconi\AppData\Local\Temp\Arduino4D171103113854902/prova2.ino.bin to flash at 0x00000000
    .
    .
    .
    .
    Completed RC=0

    It loads to the board (but with the message under th box while falshing the led on he programmer but after the reset, the display is only blank black with backlight on.
    What are my mistakes?
    Thanks in advance
    Matteo

  • #2
    Hello Matteo,

    Welcome to the forum

    You don't have to worry about the message "Device is not responding". That message panel is only intended for 4DGL based displays and no Arduino type displays. All you need to do is set both ports the same in this area to correspond with the com port for the IoD which you have done.

    Could you possibly send me your code. It looks like the uploading to the IoD was successful but just not displaying on the screen.

    Best regards

    Paul

    Comment


    • #3
      Thanks Paul
      this is the code of a simple text (Prova) in the midde of the display
      I've noted that tex "begin" and "yield" are orange...

      #include "ESP8266WiFi.h"
      #include "GFX4d.h"

      GFX4d gfx = GFX4d();

      #include "prova2Const.h" // Note. This file will not be created if there are no generated graphics

      void setup()
      {
      gfx.begin();
      gfx.Cls();
      gfx.ScrollEnable(false);
      gfx.BacklightOn(true);
      gfx.Orientation(PORTRAIT);
      gfx.SmoothScrollSpeed(5);
      gfx.TextColor(WHITE, BLACK); gfx.Font(2); gfx.TextSize(1);
      gfx.Open4dGFX("PROVA2~1"); // Opens DAT and GCI files for read using filename without extension. Note! Workshop generates files with Short filenames
      } // end Setup **do not alter, remove or duplicate this line**

      void loop()
      {
      gfx.UserImage(iStatictext1) ; // Prova

      // put your main code here, to run repeatedly:
      yield(); // Required for ESP
      }

      Comment


      • #4
        Hello,

        Your code works just fine.

        The only thing that could be wrong is that the files are not on the SD card. You can re-generate the graphics files by taking the SD card out of the IoD and inserting it in your PC, then press shift & F9, select your SD card in the Copy Confirmation dialog box and then click OK. The code will be uploaded to the IoD again. Insert the SD card back in the IoD and then press reset.

        I hope this helps

        Best regards

        Paul

        Comment


        • #5
          Hello
          with the sd card in the board, I've tried add something else as you can see in the code below
          - the text
          - a green circle
          - a knob
          but just the circle appear on display.. what's wrong? thanks

          #include "prova2Const.h" // Note. This file will not be created if there are no generated graphics

          uint16_t x;
          uint16_t y ;
          uint16_t degres;
          uint16_t posit;
          void setup()
          {
          gfx.begin();
          gfx.Cls();
          gfx.ScrollEnable(false);
          gfx.BacklightOn(true);
          gfx.Orientation(PORTRAIT);
          gfx.SmoothScrollSpeed(5);
          gfx.TextColor(WHITE, BLACK); gfx.Font(2); gfx.TextSize(1);
          gfx.Open4dGFX("PROVA2~1"); // Opens DAT and GCI files for read using filename without extension. Note! Workshop generates files with Short filenames
          gfx.CircleFilled(105, 139, 20, LIME) ; // Circle1
          gfx.UserImage(iStatictext1) ; // Statictext1

          gfx.imageTouchEnable(iKnob1, true) ; // Knob1 show initialy, if required
          gfx.UserImages(iKnob1,0) ; // Knob1 show initialy, if required
          } // end Setup **do not alter, remove or duplicate this line**

          void loop()
          {

          degres = gfx.XYposToDegree(x-110, // x - CentreX
          y-258) ; // y - centreY
          if (degres < 45) // anything in the first 'dead zone' is minvalue
          degres = 0 ;
          else
          {
          if (degres > 315) // anything in the last 'dead zone' is maxvalue
          degres = 270 ;
          else
          degres -= 45 ; // offset by -baseangle
          }
          posit = degres * 100 / 270 ; // convert degrees to position
          gfx.UserImages(iKnob1, posit); // Knob1

          // put your main code here, to run repeatedly:
          yield(); // Required for ESP
          }

          Comment


          • #6
            Hello,

            Could you please check the contents of your SD card to see if there are 2 files on there PROVA~2.GCI & PROVA~2.DAT

            Thanks

            Paul

            Comment


            • #7
              Hi
              yes both files are on sd card

              Comment


              • #8
                Hello

                Ok Thanks for that. Can you also let me know what type, size of SD card you are using and did you format it with RMPET under the Tools tab of Workshop.

                Paul

                Comment


                • #9
                  I'm using a verbatim sdhc 16gb, formatted with rmpet with a 4gb partition FAT16.
                  I've tried to insert some kind of widget but the only displayed are the primitives (loaded also without sd inserted)
                  As the copiler ask, i put the card in the pc during compiling, then i disconnect the board (turn off) and mount the sd on it.

                  Comment


                  • #10
                    Hi

                    Thanks for that,

                    Can you please follow the instructions here to change the size of your SD card http://www.instructables.com/id/Form...T16-not-FAT32/

                    Best regards

                    Paul

                    Comment


                    • #11
                      It works!
                      thank for your help!
                      So the board has to "see" a sd card FAT formatted with less than 4Gb?

                      Comment


                      • #12
                        Hi,

                        Glad you got it working.

                        This is only in Workshop to comply with the FAT16 requirement with the IDE. The IoD can use FAT32 up to 32GB in the Arduino IDE.

                        Paul

                        Comment


                        • #13
                          Hi
                          i've been starting to work with my module and using it with widgets and image.. it works fine
                          But I've a new problem: i'm trying use the wifi module and i've some problem compiling..
                          following my code (copie from an example):

                          #include "ESP8266WiFi.h"


                          #include "GFX4d.h"
                          GFX4d gfx = GFX4d();


                          #include "provawifiConst.h" // Note. This file will not be created if there are no generated graphics

                          /**************************************************************
                          * WiFiScan *
                          * A Demo to show all available access points with a signal *
                          * strength meter. *
                          * This demo shows the hardware smooth scroll feature which is *
                          * available only in PORTRAIT and PORTRAIT_R Modes. *
                          * This demo will not connect to the internet. *
                          * *
                          **************************************************************/

                          void setup()
                          {
                          gfx.begin();
                          gfx.Cls();
                          gfx.ScrollEnable(false);
                          gfx.BacklightOn(true);
                          gfx.Orientation(PORTRAIT);
                          gfx.SmoothScrollSpeed(5);
                          gfx.TextColor(WHITE, BLACK); gfx.Font(2); gfx.TextSize(1);
                          gfx.Open4dGFX("PROVAW~1"); // Opens DAT and GCI files for read using filename without extension. Note! Workshop generates files with Short filenames

                          WiFi.begin("mynet", "12345678");

                          gfx.print("Connecting");
                          while (WiFi.status() != WL_CONNECTED)
                          {
                          delay(500);
                          gfx.print(".");
                          }
                          gfx.println();

                          gfx.print("Connected, IP address: ");
                          gfx.print(WiFi.localIP());
                          }

                          void loop() {
                          // listen for incoming clients
                          WiFiClient client = client.available();
                          if (client) {

                          if (client.connected()) {
                          Serial.println("Connected to client");
                          }

                          // close the connection:
                          client.stop();
                          }
                          }

                          The WiFi.mode(), WiFi(). work fine , but when I add the code inherent to the client services the compiler return to me the follow error:

                          In file included from C:\Users\Meliconi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266W iFi\src/ESP8266WiFi.h:39:0,
                          from C:\Users\Meliconi\Documents\prova2\provawifi\provawifi\provawifi.ino:5:
                          C:\Users\Meliconi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266W iFi\src/WiFiClient.h: In function 'void loop()':
                          C:\Users\Meliconi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266W iFi\src/WiFiClient.h:38:3: error: 'WiFiClient::WiFiClient(ClientContext*)' is protected
                          WiFiClient(ClientContext* client);
                          ^
                          provawifi:47: error: within this context
                          WiFiClient client = client.available();
                          ^
                          provawifi:47: error: invalid conversion from 'int' to 'ClientContext*' [-fpermissive]
                          In file included from C:\Users\Meliconi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266W iFi\src/ESP8266WiFi.h:39:0,
                          from C:\Users\Meliconi\Documents\prova2\provawifi\provawifi\provawifi.ino:5:
                          C:\Users\Meliconi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266W iFi\src/WiFiClient.h:38:3: error: initializing argument 1 of 'WiFiClient::WiFiClient(ClientContext*)' [-fpermissive]
                          WiFiClient(ClientContext* client);

                          What are my mistakes?
                          Thanks in advance for your help..
                          Matteo

                          Comment


                          • #14
                            Hello,

                            You should change this.

                            WiFiClient client = client.available();
                            if (client) {

                            To this.

                            WiFiClient client;
                            if(client.available()){

                            Also it would be good to add this function as gfx.print wont be able to print the IP address.

                            String ipToString(IPAddress ip){
                            String s="";
                            for (int i=0; i<4; i++)
                            s += i ? "." + String(ip[i]) : String(ip[i]);
                            return s;
                            }

                            and change this line.

                            gfx.print(WiFi.localIP());

                            to

                            gfx.print(ipToString(WiFi.localIP()));


                            I hope this helps

                            Best regards

                            Paul


                            Comment

                            Working...
                            X