Where do I begin?

CubicC

New member
Hi, all. I am building a Linux appliance and purchased the 633 for the front panel display. I want to allow the user to do (what I think are) trivial tasks, such as enter an IP address. I have read the manual, and I looked at the "Ultra simple Windows command-line demonstration program with C source" as well as the "Linux-compatible command-line demonstration program with C source code". All I can get out of these is how to send a "Hello World" type of message to the display. I can't imagine there aren't many other customers who have done this already, and I don't want to re-invent the wheel trying to figure out the optimal way to trap keypresses to increment digits in the IP address, etc.

Where can I start? I tried looking at CrystalControl2, but it seems like it is more for Windows users monitoring (and having fun with) their PCs, as opposed to producing code for interacting with the device. One thing I noticed is that the "Hello, World" apps have in their Read Me files a line to the effect of "AppWizard has created this 633_COMMAND_LINE_TEST application for you.". Is there some program named AppWizard that can generate code for me?

TIA.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

CubicC

New member
thanks for the quick reply! Unfortunately, it seems that all of those (other than the commercial one which is just custom programming services) are output-only. I understand the output from the simple Hello World apps. I am looking for something that let's the user INPUT data to me, such as an IP address, using the arrow keys and the cursor. Any other ideas?
 

CF Tech

Administrator
Hmmm. I thought for sure that LCDproc has some way to read the keys. Maybe try posting on that mailing list, it is quite active.
 

CubicC

New member
I don't understand why my request is so unique -- are CrystalFontz products used in appliances that are sold as part of a business industry, or are they mostly "gamer" add-ons? One would think that from the business perspective, there have been at least hundreds of customers using these in hardware appliances, and allowing the user to input IP address -- you advertise this in the instruction manual as an ideal application for your products... Should I be asking this question in a different area of the CrystalFontz forums?
 

CF Tech

Administrator
You are right, the appliances are where most of the displays end up, and entering the IP address is a common use.

Typically a company that sells an appliance is essentially a software that is packaging their software in a "ready to use" appliance form. I guess since these customers are software people, they just "knock out" some small application to talk to the display. The ones I have talked to personally are happy to have some sample source, then that is typically the last I hear from them on the software side.

As far as what we have available, there are the Windows test programs, and the simple Linux examples.

If a company does not have the resources to develop an application in-house, then the LCDIntegration folks can take their base code and adapt it to the company's specific needs.
 

CubicC

New member
Right, so are there *any* samples, for either platform (because it's just C, and receiving inputted data), that demonstrate a user inputting an IP address?

Thanks again.
 

CubicC

New member
Do you have any other suggestions? Again, you stated that you have many customers doing the same thing I am looking to do. Wouldn't that warrant some sample code for inputting IP addresses from your end, instead of just tools that display MP3 info and other "fun", non-business applications? It seems you spent a lot of time and effort producing CrystalControl (v1 and v2) for the non-business customers...

Also, is there an emulator that you produce which I can use to program against? For any OS?

Thanks again.
 

Heffo

New member
All the customers who are doing the same thing as you are wanting to do are big businesses who have their own software development teams, who don't need examples to figure out how to input an IP address. They also tend to like to keep their source code to themselves in order to keep control over their intellectual property.

My suggestion for entering an IP would be to monitor the Up/Down/Left/Right buttons, and use the Up/Down buttons to adjust the currently selected digit, and Left/Right to move the cursor and select a different digit.

If you want a way to develop software for multiple OSes then I would suggest using Microsoft's C# and .NET platform. It's rather easy to use, the APIs are reasonably well thought out, and you can download and use the MONO project to run .NET application in Mac OSX and Linux without the need to recompile your exe (so long as you programmed with MONO in mind).
 

CubicC

New member
Right, but there's a lot more to handling the inputting of an IP address than simply listening for each button press. There are core "best practices" around waiting for button press vs. holding the button down for a period of time, event models, and cursors to deal with. That's why a sample from CrystalFontz regarding "best practices" would be ideal.

And companies do not want to keep all their source code to themselves -- all developers everywhere use libraries, sample code snippets, and other utilities to get up and running quickly, using a "best practice" or wrapper methods, so that they don't need to re-invent the wheel or run into unforseen complications down the road. They take what is available to them, and they enhance it to meet their needs, and then keep that finished product as intellectual property.

Also, I am not looking for a cross-platform development environment. These displays communicate via a serial port. So all the C code can be the same, regardless of the platform (slight differences in the serial API libraries, but not much else). It's the packet communication that makes these displays work, and that is OS-agnostic. My point was that if there is a tool or some sample code showing what I want to do, *for any OS*, I would embrace it and modify it trivially for my needs.
 

CF Tech

Administrator
LCDproc IP Address

I searched through my LCDproc archives and came across this snippet:
I've a problem using LCDproc 0.5's (CVS) menu item for entering IP
addresses. The problems occurs in a small application I've written.

I developed it on a Debian/Sarge linux box and it worked just fine. But
when I tested it on a freshly installed SuSE 9.3, the following problem
showed up:

If I enter 192.168.002.158, and press enter at the rightmost character,
then LCDd gives the following message:

menuitem_process_input_ip(id="CHIP") ip address not verified

When using the curses driver, I can see "Invalid Address" below the
entered IP.
There are several messages on the issue, ending with:
I corrected the problem.

The cause was that glibc's inet_pton() changed its behaviour.
In older versions it accepted leading zeroes in the octets of an IPv4 address
(e.g. 192.168.002.123). In current versions it does not accept them any more.

To cope with the new situation I changed the routines so that leading 0s get
stripped.
So please take a look at the latest and greatest LCDproc version and I think perhaps this issue has already been done:
http://sourceforge.net/project/showfiles.php?group_id=119&package_id=107&release_id=504158
 

CubicC

New member
Thanks. I tried the CrystalFontz WinTest app before I started this post, but I couldn't find enough documentation to tell me how to get it to generate code or packets, or even what it is supposed to be generating for me :)

I will download and build LCDProc over the next day or so and dig in. I had looked at all the plug-ins for it (from sourceforge and freshmeat), but found nothing there, and the main LCDProc documentation described a lot about displaying information, but not about inputting. Hopefully I will be successful, and I'll post my results for everyone else to read.

Thanks for all your help!
 
Top