Photon/4DSystem using VisiGenie?

I am developing a data logger for clinical trials (as part of my son’s PhD program) using a Photon and a 4DSystems display (glass bezel version for infection control reasons). Our current version is based on an Arduino Nano and a small Oled display.

It looked as though a quick prototype could be put together by coupling a GUI developed with VisiGenie to the Photon. 4DSystems have an application note showing how to connect an Arduino processor to a VisiGenie GUI.

The github respository indicates that the application was updated to handle Particle devices. However I have tried to compile it under Particle Dev but end up with a bunch of compiler errors.

Can anyone point to relevant libraries or example code for a Photon?

Thanks
Bruce

Common practice for such cases would be to provide links to your external resources to save us from needing to dig up the info you already found and a description what didn’t work and what the error messages were.

1 Like

Thanks - should have done so and will provide details later this evening. Thanks for your quick response.

@OziGreybeard, actually, the github change comments show that the Particle stuff was reverted (removed), so that may explain some things. I'll take a look at the code to see what needs to be done. I will update the Build library to the newest code version tonight if I can. :wink:

Thanks - I would appreciate any assistance/insights. In y days as a junior scientist I programmed in Fortran. Having recently retired I find myself making the jump to Matlab, C++, development environments we would have killed for. Above all I appreciate the willingness of participants on these bulletin boards to freely provide advice and assistance.

I have been otherwise committed for the past few days but am now back focussing on this and related issues. The last couple of days have involved an effort to convert the SD card logging software to the Photon using FsFAT. I basically have the file writing working but am have run into an issue creating a simple CSV file that can be read by Excel as the f_puts and f_printf routines stip the null from the end of the strings. If I can not crack that this evening I may have t seek advice on that issue as well.

I will be back to the display code tomorrow and will provide a summary of my efforts to date.

Thanks to both of you for offering to assist. It’s much appreciated.

I guess you mean the readily available SDFAT library :wink:

CSV files don't require zero bytes in the stream. If you have a CR/LF in there Excel can still read the files.

To write binary data (which a zero byte is) you'd neet to stay clear of the string functions - rather go with write().

1 Like

Thanks - a seniors moment :sweat_smile: I have looked briefly at both SDFAT and FAtFs, both of which are available for the Photon. It was in fact FatFs which I am testing at present.

I was trying to create a file with multiple variables separated by commas. I can read the file in Excel but all of the vales lie on a single row with pairs of numbers in each. Column,

I will have a look at using write in the morning,

Thanks _ much appreciated.

@OziGreybeard, have you tried the VISIGENIESPARK library on Build? There is demo code which uses Serial1 of the Photon.

@peekay123 I just received a 4D Systems 3.5 Inch Gen 4 LCD and have it up and running with their Workshop 4 PC Software.

I can say that the Workshop 4 software is leaps and bounds better than the Nextion software when it comes to programming the LCD screen layout with custom text, images, and even video which I have not got working yet.

I see there is the VisiGenieSpark library on the Build Library and it still compiles just fine with the latest Particle firmware.

My next step will be to figure out how to get the Photon & 4D Systems Display communicating together so I can get the global variable data that is on the Photon to display and update on the LCD.

I know the VisiGenieSpark library has a template to show the basics of this communication and I’m about to dig into that but I wanted to ask if you ever used this library and if so is there anything I should know before jumping into all this.

It would be nice to know you have a 4D Systems Display around incase I hit any roadblocks and need professional assistance :smile:

It’s also nice to see 4D Systems has a active user form to suppor their products.

Thanks. I have it working using the files from the Library. I did not bother with the demo program but used it to work out what I needed for my logger.

I have one remaining issue to solve. I can create several VisiGenie objects for strings (eg clock, status messages) with VisiGenie but, unlike WriteObject function, the WriteStr function does not include the ability to identify specific object.

My problem with FatFs was a stupid oversight - I had not included \n in the string!

Any views as to the relative merits of FatFs and SDFAT woukd be appreciated.

It worked first time for me. The 4DSystems and Particle Photon development environments made it easy, as did the Application Notes for the 4DS displays.

I have been developing a data logger for use in clinical trials and have found that to date I have not had to use other Visi Genie. A couple of the application notes helped me get started but after that it’s been a matter of the Reference manual and looking inside the device driver on occasion.

Best of luck - let’s know if I can be of any assistance (although there are a number of extremely helpful participants on the board who have vastly more experience than I do eg peekay123).

SDFAT is the successor of FatFs written by the original creator of FatFs (which is years old already).
SDFAT also supports DMA which would be the killer feature over FatFs even on its own IMHO.
But SDFAT has little improvements all over the place and is actively maintained while FatFs doesn't get too much attention anymore - as it's been superceeded.

1 Like

I have one remaining issue to solve. I can create several VisiGenie objects for strings (e.g., clock, status messages) with VisiGenie but, unlike WriteObject function, the WriteStr function does not include the ability to identify the specific object.

I need to pass some strings with status info over to the 4D Systems display also. Is this WriteStr function currently not working? Have you asked about this on the 4D Systems forum?

I recall being able to write the string objects but there was some trick to it. I’m looking for my old code.

1 Like

@RWB, to be fair, 4D Systems takes a different approach than Nextion and both have benefits. What is missing from Nextion is a number of predefined objects like those found with 4D. VisiGenie is great but has its limitations. Nextion allows some amazing on-display computing that is a lot more difficult on the 4D units. If FTDI had a GUI like 4D or Nextion for their displays, their displays would rock IMO.

Strings can be written to and WriteStr() DOES take an object index to specify the string to write to. The demo app in the IDE library does exactly that!

I am using writestr to update status as well as date, time, etc

I using Visie Genie and to date have not found it necessary to delve into the other more capable options.

The only ‘trick’ I am aware of is the need to address the specific string if you are using multiple menus. Only those messages for strings on the current display page are displayed.

I will cut an example from my code this evening.

1 Like

I just got the VisiGenie program loaded onto a Photon with a 3.5" LCD attached.

The only changes I had to make to get it working was to change the Serial1 data rate to 200000 from the set 115200.

I also had to reverse the Reset Line states since they were reversed.

The data on the screen is updating as expected now and I’m excited to get this working with my current application.

@OziGreybeard I will have multiple screens so your example and any advice is certainly appreciated :slight_smile:

I’m loving how easy their software makes it to create a slick good looking menu system in very little time.

1 Like

Having come from a Fortran environment in the 80’s and then a senior management position in an R&D lab it was a pleasure to find the ease with which the Particle and 4DSystems development environments could be used.

I was going to include image of one of the screens from my current development but am not sure how to do so - code example will follow this evening


Found it

Thanks - not sure what happened here. This message was posted back in Dec/Jan but did not appear until now.

I have continued to use FatFs as it met my immediate needs (on the basis that better is the enemy of good enough) but am in the process of moving over to SDFAT to get the benefit of DMA.