No announcement yet.

File uploads, genie-program updates via RaspberryPi UART Serial

  • Filter
  • Time
  • Show
Clear All
new posts

  • File uploads, genie-program updates via RaspberryPi UART Serial

    Hello, and greetings to all staff and other forum members.

    I hope everyone is fine today and also someone may be able to help me with some basic Questions.

    First I'd like to provide some background Information. My task is to provide a touch screen based control solution for classrooms at the University I work for. Specifically functions like "Projector on/off", "choose between sources for the projection" and "turn on/off the Lecturers Desk" and some other minor things.
    We already have a physical button-based control in place (Kramer 4K RC-IRE), and most of the functionality/communication is UART-Based.

    Our upgrade concept so far includes the replacement of this control in favour of a combination of the GEN4-ULCD-43DCT-CLB-SB Display and a Raspberry Pi.
    Since we need the Raspberry Pi for certain functions there is little to no way around it.

    After some exploration of the IDE and basic functionality of the Display, I am leaning towards a genie-Based Design on the Display itself, which will be attached to a RaspPi via UART.
    So far this works like a charm (apart from a minor adjustment of the genie-Library for linux - but this is for another topic/bugreport). The RaspPi can communicate with the Display (recieving commands and sending back updates).

    But as there will be about 14 Classrooms in the future, which will be supplied, ease of support will be an important aspect. Since the layout of the display and its controls will most likely change in the future, there might be need to upgrade the program code frequently.
    And finally here's my question:

    Is it possible to use the IDE to develop a genie-Based Program for the display, compile all the needed files and provide everything to the display using the RaspPi? Without the need to remove the uSD card from the display?

    As far as I understand it there are some file-operations in the 4dgl instruction set, that allow files to be erased and new files to be created. And since it is possible to extend the genie-Programs with 4dgl code(Workshop4 Pro), My theory would be to include the possibility in a genie-Program to upload and replace the "old" files with the newly compiled ones. After that trigger an update to load the new .4xe program to be used by the display.

    Or is there another solution which I am not aware of?

    If you need any further information, please feel free to ask!

    Any help and comments are much appreciated, and you have my thanks in advance.


  • #2
    Hello Kai,

    Welcome to the forum.

    Thank you for your greeting.

    Yes this is very possible and can be accomplished in many different ways. You are correct in saying that you can access the file operations via Serial and Visi-Genie with Workshop pro features enabled.

    One approach that has recently been used is to have the display running in its default Serial SPE environment. The RPi at power up will send a reset to the display and the display initializes into the serial environment awaiting commands for the RPi. If there is an update to do then the RPi sends a command and then initiates the transfer of updated files to the SD card of the display. On successful write to SD the RPi can then call the new Visi-genie .4XE file to run. If no updates are required then the RPi can call the .4XE it knows was installed to the display. After the .4XE has been called, the display will then be running in the Visi-Genie envronment.

    You can also do all of the above inside the Visi-Genie environment using the additional user code and 4DGL file functions to transfer files over to the SD card and run the .4XE from the SD card as in the other example.

    I hope this helps

    Best regards



    • #3
      Hello Paul,

      thank you very much for the timely reply. This is indeed a great help!

      I have not come across the "call 4xe as a program" functionality yet. If I would hazard a guess, I'd say its the file_Exec command, right?
      Is there an AppNote about this topic?

      And just to confirm my further thoughts on this: I would use a separate GPIO Pin from the RPI to connect to the reset-pin, correct? (the 4d-Serial-Pi Adaptor has the RESET Pin disconnected)

      you've been a great help so far!

      Thank you!


      • #4
        Hello Kai,

        The file_Run command would be better as it resets variables etc. In visi-genie you have the option to run from SD card and it will create a .4XE program for the SD card to run when the display boots.

        Yes, you would connect a the reset to a seperate GPIO on the RPi.

        Best regards



        • #5
          Trying to figure out how to update the the LCD screen built into a product where the SD card is not accessable.

          My product has a Particle Photon Wifi module built into it which allows for downloading files from the web which I would need to push to the SD card on the 5 inch gen 4 LCD display to get the new firmware loaed onto it adn run. Can this be done over just the serial UART connection only? Not sure how long it would take to transfer 0.5 Gig of SD Card Data over UART if that is possible.

          I'm limited on GIPO pins on the Photon so UART is the only communication method that I have to work with at the moment which may or maynot work for this?


          • #6
            if you write the protocol in visi it might be possible, but still a complex way of doing it. ive seen someone make a sd "switch" however they never productioned it, but the schematics and commands can be retrieved from their google link. you could use your photon to
            1) control lcd resets
            2) "switch" the "sd switch" via uart command from photon, then update sd card via your photon sd card access spi or whatever, theb "sd switch" back to drop card back on lcd, and trigger a reset if necessary.
            the module has 1 sd slot for a uSD, 2 male headers for lcd and photon uSD slots, and a FTDI header(to send console switch command)

            if you do find any production models or alternatives, let us know


            • #7
              I thought about that actually.

              Do you have a link to the Google documents for the switch your referring to?

              I already have code that will download files from a weblink to a SD card over WiFi using the Photon. The SD Card was connected using SPI for fast read and write times, I just don't have the extra pins for that unless I add a I/O port expander which may be what I need to do if I want to go this route.


              • #8


                • #9
                  I'm going to design an SDcard extender that will allow me to put the SD card in the 4D systems SD card slot and then have a flex cable run to my main PCB with an SD card holder so the 4D Systems and my Photon micro can share the SD card. The Photon will be able to download the new 4D systems display files over Wifi and then we can trigger an LCD reset to run the new updated LCD files.

                  It will look similar to this, except the flex cable socket will be on the top side of the PCB since there is no room on the bottom side for it the way the 4D systems PCB is laid out :


                  • #10
                    neat. just be aware that extender cables already exist on fleabay that already work, between 1-3$, one kind has pcb ribbon, another is a gray ribbon version, youd need to snip off the pullup resistor on the grey version for it to work on the 4D lcds


                    • #11
                      I looked at a thousand different ebay listings and not one of them would fit or work with the 4D display SD Card socket due to the ways it's laid out with limited spacing and surface mount caps and resistors. right behind the SD card slot. A custom board is required, but that's no big deal, I'm just happy there is a way to update the screen remotley.


                      • #12
                        heres a few samples, of both ribbons used
                        the white ribbon fits a little snug in the socket but works
                        the brown ribbon fits nicely in the socket and very flexible
                        Attached Files
                        Last edited by tonton81; 19 November 2017, 05:13 AM.


                        • #13
                          I need to go from the 4D SD card socket to a ribbon cable to another PCB that has a SD Card Socket that the Particle Photon can access also.

                          I don't need to just extend the SD card socket.

                          Thanks for the pictures though.