AdvancedHMI Software

General Category => Tips & Tricks => Topic started by: Archie on February 28, 2015, 09:18:50 AM

Title: AdvancedHMI on a Raspberry Pi
Post by: Archie on February 28, 2015, 09:18:50 AM
Here is how to run an AdvancedHMI application on a Raspberry Pi

1) Download the Debian Wheezy image
http://www.raspberrypi.org/downloads/

2) Copy the image to the MicroSD card using Win32DiskImager
3) Install the card and boot up the Pi
4) When it gets to the configuration screen, set it to expand the image and also to boot to a Graphical User Interface
5) Select Finish in the configuration and Reboot
6) Once booted into the GUI, open a Command Prompt
7) Type these series of commands:

sudo su
apt-get update
apt-get install mono-complete
apt-get install mono-vbnc

8 ) Put in a memory stick with an AdvancedHMI application on it
9) In the command prompt, use the "cd" command to browse to the memory stick to the directory /bin/debug
10) mono AdvancedHMI.exe

In a few seconds the application should start.

There are a few things you may run into.

- You cannot use an OPC server because it is not a .NET application
- The MessageDisplayByValue may stop the application because it uses a speech library. There is a work around. Find System.Speech.DLL on your Windows PC and copy the file into the /bin/debug directory
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on March 04, 2015, 02:54:22 PM
I recently received the new Raspberry Pi and it is noticeably faster. The price is the same, it is faster, has more memory, and uses the same OS, so the above configuration works exactly the same.

I'll be releasing a new version of AdvancedHMI that has some modifications to make things work better on the Pi. The will be version 3.97g or later.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: dmroeder on March 17, 2015, 02:29:46 PM
Holy moly, I had heard of mono, but didn't realize that this was possible.  I have actually been tinkering with some python code that will read/write so that I could log some data from Linux.  I have a Pi at home too, I'll have to give this a go.

Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on March 17, 2015, 03:38:49 PM
Be sure to use version 3.98 or higher because it has some changes that allow the AB drivers to work.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: dmroeder on March 17, 2015, 03:47:51 PM
Good to know, thanks.

I've was hunting around earlier for a panel mount display to pair with this.  I'm going to try to find something that does not have touch for an inexpensive information display.  I notice that anything panel mount is pretty much the cost of those IVC touch PC's.  Some are more expensive for just a display!
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on March 17, 2015, 04:18:18 PM
I found the same thing over the years with the panel mount monitor being about the same price as a full panel mount PC. I've been gathering parts up to see what is the lowest cost I can get on a 48" TV with a Pi and everything needed for a working production display. I'm also in the process of getting a panel mount case designed for a 7" display and Pi. The goal is to be able to sell a unit in the $150-$200 range for the non-harsh environment uses.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: dmroeder on March 17, 2015, 05:11:35 PM
Cool, I like that idea.  I was kind of looking for the same thing.

I understand that these types of monitors are more specialized (and not in the same demand) than the run-of-the-mill monitors we typically but but I can pick up a 50" tv as a display for half the price of some of them!
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: dmroeder on March 17, 2015, 08:01:27 PM
Check out Chalkboard Electronics]http://www.chalk-elec.com/]Chalkboard Electronics (http://www.chalk-elec.com/).  Maybe I'll pick a screen up from here one of these days.  It's funny, the touch enabled screens are only a few dollars more.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: johwaa on March 21, 2015, 04:55:41 PM
Wow! Now this is some cool stuff! I've got my new Pi already, and I'll be getting one of those touchscreens as well. Thanks guys!!
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: dmroeder on March 23, 2015, 03:00:14 PM
Wow! Now this is some cool stuff! I've got my new Pi already, and I'll be getting one of those touchscreens as well. Thanks guys!!

if/when you do pick up one of those screens, I'll be curious on what your thoughts are.  I had thought about it myself.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: johwaa on March 23, 2015, 07:57:33 PM
I'll definitely do that. But at the moment they are out of the big ones. I just sent them a message inquiring about when they expect to have it back in, we'll see what they have to say.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: johwaa on April 11, 2015, 02:49:58 AM
Well, I got my touchscreen in and it consists of the bare essentials. Meaning that the glass is not in a frame, and has no protection whatsoever. I'm not even going to attempt to wire it up until I come up with something to put it in.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on April 11, 2015, 05:41:32 AM
Well, I got my touchscreen in and it consists of the bare essentials. Meaning that the glass is not in a frame, and has no protection whatsoever. I'm not even going to attempt to wire it up until I come up something to put it in.
With the Tontec screen, you can also buy a case for it:

http://www.itontec.com/product-detail/product-name-9/

Title: Re: AdvancedHMI on a Raspberry Pi
Post by: johwaa on April 11, 2015, 09:30:09 PM
Thanks,  But it's kinda small for my needs, I bought the 15.6" one... :)

I'll getto it up for the time being (using plastic cardboard comes to mind), but it's going to have to have a more permanent home.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: doggo on April 12, 2015, 11:44:36 AM
http://www.itontec.com/about-us/

I love this part:

About

Keep connecting, keep simple.Tontec are primarily focused on the wireless communication technology, we aims at providing electronic products of premium quality at fair price with great customer service. Nowadays our main products are Bluetooth remote shutter, powerbanks,Bluetooth speakers;In the long run we will provide more products depending on the consumer’s demand. We devote ourselves to to make your life much simpler and more wonderful.


:)

Title: Re: AdvancedHMI on a Raspberry Pi
Post by: johwaa on April 15, 2015, 06:59:59 PM
Sounds like a mission statement that I have heard in the past a time or two. I prefer to get my motivation from here:

http://www.despair.com/
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: daveyh on June 08, 2015, 12:12:21 PM
Any hope of getting OPC support?

>>- You cannot use an OPC server because it is not a .NET application
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: daveyh on June 08, 2015, 12:22:10 PM
What about running Windows 10 on the Pi? Would that work?

Thanks


>Any hope of getting OPC support?

>>>- You cannot use an OPC server because it is not a .NET application
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on June 08, 2015, 12:40:34 PM
Any hope of getting OPC support?

>>- You cannot use an OPC server because it is not a .NET application
OPC is ActiveX technology based on Windows only. It won't work easily on any other OS. I'm not sure how much Windows 10 continues to support ActiveX. It is still up in the air whether Windows 10 on the Pi will be able run AdvancedHMI. All of the visual controls are based on WinForms and it looks like Windows 10 will be focused on Universal Apps.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Zip on August 10, 2015, 09:14:14 AM
Hi Archie,
                  I am hoping to connect use AHMI on an RPi connected to a plc communicating via ModbusRTU. I have been using this perfectly from PC and i am fairly sure my issue lies  with the com port setting in the RTU Driver within AHMI. I assumed it should be /dev/ttyUSB0 which my pi is showing as location of the usb-serial i am using. Also tried /dev/ttyAMAO with a GPIO-serial adapter with no luck. I am fairly sure my serial setting are all set correctly via minicom so i dont think there is an issue there. Any suggestions would be greatly appreciated.

Zip
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on August 10, 2015, 08:13:46 PM
Unfortunately I do not have any good advise. I have never setup the Pi with a serial port.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on August 11, 2015, 01:52:43 AM
Would Vitor's experiment provide any help:

http://advancedhmi.com/forum/index.php?topic=899.0
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Zip on August 11, 2015, 05:37:29 AM
No worries Archie. I will keep trying. My PLC is recieving data sent via serial from pi so i know my connection is good. 99% sure it is just identifying the com port of the Pi in the ModbusRTU driver. On my PC COM3 etc works a treat but Pis /dev/ttyAMAO or /dev/USB0 cant be opened by AHMI. I can find my way around Pis and PLC ok but my VB skills are non existant.

@Godra
I had read through this thread previously but cannot open the link inside of the downloaded files. Ethernet communication or modbusTCP via a gateway is the next route i will explore, just trying to keep it identical to how we connect via our pc's.

Thanks for your comments!
Great forum and fantastic product Archie
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Vitor on August 11, 2015, 06:38:04 AM
Hi,
I have corrected the link, it was missformated, sorry.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on August 11, 2015, 12:19:49 PM
If mono is similar to wine then you might try to use the same logic as described here:

http://g8ogj.org/files/Using%20USB%20serial%20ports%20under%20wine%20howwto%20ipb.pdf

I am not currently familiar with mono but it does sound like wine.

Here is another link, with a sample code to test serial port in mono (intended for Archie to compare with the AHMI code):

http://www.mono-project.com/archived/howtosystemioports/
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on August 11, 2015, 03:12:56 PM
According to website, the SerialToIP command line version can run in Mono and list available COM ports:

http://sourceforge.net/projects/serialtoip/?source=directory
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Zip on August 11, 2015, 10:00:27 PM
Awesome guys. Sounds promising. Thanks for taking the time. I will have a crack as soon as i get back. Will let you know how i get on.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Zip on August 17, 2015, 08:19:20 AM
Hi Guys,
             Still Bashing head on desk with this one.
Is it possible that the ModbusRTU driver is not recognising /dev/ttyUSB0 for the Port Name? Does it need a COM address. May be due to declining options but I feel as though Godra's suggestion of 'Linking' a COM port with /dev/ttyUSB0 would be successful, unfortunately I cant get that to work in Mono on my Pi. I am unfamiliar with wine, but from what i have googled/hunted for in my pi there is no equivalent to DOSDevices in MONO. I tried a symlink but could not get that to associate with Mono (damn my limited linux knowledge).
PLC is receiving bits through minicom (RX flashing when I push keys) and everything seems to check out with /dev/ttyUSB0 in set serial etc.
FYI i am using a USB to Serial converter into com port 1 of my PLC which runs perfectly with AHMI on Windows (port name COM1)
Tried installing UBUNTU MATE today to see if there was any change but coming up with the same 'FAILED TO OPEN /DEV/TTYUSB0"
At the moment I am trying to install QT Creator to see if I can get Qmodbus-master communicating. Does not do what I require but may help me whittle down where my issue lies. Just thought I would put this out there in the meantime.

@Vitor. Thankyou for reposting link. Unfortunately mu PLC doesnt support TCP without a gateway (as far as I can gather)
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on August 17, 2015, 10:22:22 AM
I would suggest you read Vitor's pdf file again.

He is using Pi, USB-RS232 adapter, ser2net software whose configuration shows /dev/ttyUSB0:

192.168.1.5:4001:raw:300/dev/ttyUSB0:19200 8DATABITS NONE 1STOPBIT

and also com0com and Serial-Tcp software on PC side.

He even mentioned using ModbusRTU device.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Vitor on August 17, 2015, 11:25:52 AM
One question... You want to run AdvHMI in Linux, using Mono and a serial port?
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Zip on August 17, 2015, 10:46:46 PM
Thanks Godra. Re-read Vitors post and you are correct. I must have skimmed over that before. I probably saw the IP address and immediately associated it with TCP connection. Was sifting through so much material. On the plus side learnt alot of cool stuff along the way!

Vitor. Yes i am looking at connecting my pi directly to plc via usb - serial adaptor. Am confident your method will work (prpviding i can get ser2ser etc to run ok. Will let you know of i get stuck/how i go.

Thanks again guys.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on August 17, 2015, 10:51:10 PM
Here is one more link for you which shows how to create a symbolic link in Debian Linux:

http://forums.debian.net/viewtopic.php?f=16&t=61943

If your Pi has a linux and it is any similar to Debian then these commands might just work for you (you would have to follow them exactly and see if you will be getting similar responses).
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Zip on August 17, 2015, 11:27:29 PM
Sorry, also to clarify, not nessessarily concerned about working with mono. Only that is what is running AHMI on Pi.
So i figured was relevant. I have a touch screen attached to pi to display AHMI comminicating with PLC via RTU. Looking forward to trying out these new suggestions tonight. As frustrating as this can be is a hell of a lot of fun!
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on August 17, 2015, 11:52:18 PM
Here is a new thing to try.

I have attached a GetSerial.exe file which you should copy to your Pi and run under mono, the same way you run AHMI which should be:

Code: [Select]
mono GetSerial.exe
I can only suggest you copy it to the same folder where AHMI is (or if it is on a device like USB Flash Drive or some other).

It works on MONO installed in Windows (check the attached picture) but I am not sure if it will work on Pi.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Zip on August 17, 2015, 11:57:57 PM
Thanks Godra will try that soon.
Just read a few of Vitors projects again and there is bits and pieces in there that i think i cann use to point me in the right direction. The difference being i am trying to elominate the use of a PC. I only want to use my PC to design the AHMI interface then load that interface onto the pi so i have a standalone unit consisting of pi (with touchscreen) and PLC.

Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Noe on August 18, 2015, 10:07:48 AM
Please let us know how that goes. Serial port on Pi is something a lot of us would be interested in.

I wonder if DF1 communication could be possible this way? This would lead to ultra cheap HMIs for really low budget projects or hobbist projects.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Zip on August 18, 2015, 08:46:59 PM
That's exactly what im aiming for. Cheap full colour stand alone HMI.
Will let you knkw how i get on.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Vitor on August 19, 2015, 03:23:52 AM
Until now i tried not only with Pi but with PC´s running Debian 7 and 8 with no success. But code writen in C seems to work where in V.Basic not.
For those who want to know if the serial adapter is working here is one usefull command that list all the serial ports:
dmesg | grep -i tty
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Zip on August 19, 2015, 09:19:09 PM
Still no luck.
I have a feeling modbusRTU driver would work in wine with a link between COM1 and /dev/ttyUSB0 in DOSDevices folder as Godra suggested earlier. Unfortunately i cant test that as wine wont run on pi and i have no other linux machine. Might build a virtual on windows one of these days.
Last night tried Vitors experiment connecting to plc through pi via pc using Modbus TCP driver and Ser2net on pi to link IP to ttyUSB0. Connection works (although garbled as my plc is not compatable with TCP). RxTx flashing away nicely on plc port though as soon as AHMI opened on PC.
Considering a workaround using modbustcp-rtu software on the pi. Thoughts?

Godra i tried the linux distro instructions you suggested but ourputs were significantly different. Also could not get GetSerial exe. To run. It would open briefly then close. Both GUI and Command line files did the same. May i ask the intended pupose of the GetSeriak exe? Could find a whole lot on google except for getserial errors.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on August 20, 2015, 12:29:13 AM
Zip, here are a few things I need to mention/explain:

1) In linux terminal you should always start with "sudo su", provide the password and then run "mono AdvancedHMI.exe" or "mono GetSerial.exe" or "mono SerialToIPGUI.exe" or any other program

2) GetSerial.exe is a program I created to fetch all available serial ports by their friendly names (currently it works in MONO for Windows and Ubuntu linux). It is equivalent to "ls -l /dev/tty*" command mentioned on Debian page posted previously. Vitor's command "dmesg | grep -i tty" should show currently active serial ports.

3) I just tried running SerialToIPGUI program in MONO on Ubuntu linux and this program runs as well and lists all available serial ports. Its advantage is that it has graphical user interface and runs as either a Server or a Client connecting serial port to ethernet.

If Archie could provide an option within any driver to tunnel its packets through 127.0.0.1 then, by using the SerialToIP program, the Pi could be used as standalone option for HMI (if there is no other solution of course).


@Sprungmonkey

When I use DF1 driver alone in AHMI project and start it in MONO on Ubuntu, the attached exceptions occur and the AHMI screen closes.

Don't get any of that if using ModbusRTU or EthernetIPforPLCSLCMicro drivers.

Didn't get it with older version of AHMI either (v3.84) with DF1 driver.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on August 20, 2015, 12:48:51 AM
Quote
Last night tried Vitors experiment connecting to plc through pi via pc using Modbus TCP driver and Ser2net on pi to link IP to ttyUSB0. Connection works (although garbled as my plc is not compatable with TCP). RxTx flashing away nicely on plc port though as soon as AHMI opened on PC.
Considering a workaround using modbustcp-rtu software on the pi. Thoughts?

In the same topic for Vitor's experiment I posted the experiment with 2 PCs. That setup enabled usage of DF1 driver and should do the same for the ModbusRTU driver.

You would just have to use com0com and SerialToIP programs on the PC to be able to use ModbusRTU driver and leave the Pi configured as Vitor proposed.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on August 21, 2015, 12:52:40 AM
Archie,

The SerialToIP software, when started with MONO on Ubuntu, doesn't have any issues with detecting and opening /dev/ttyUSB0 port. In the code, the author is not using anything special but SerialPort.GetPortNames() and SerialPort.Open() commands.

Is it possible that AHMI is specifically looking for string that starts with "COM" word?
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on August 21, 2015, 07:50:04 AM
I checked through the code and there is nothing restricting the name of the serial port. It defaults to COM1, but after it changes the property name, it pushes it directly to the serial port component:

                            SerialPort.PortName = m_PortName
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on August 21, 2015, 12:16:56 PM
I forgot to mention that the SerialToIPGUI version that I am running with MONO was actually converted to VB Net and compiled as exe program.

So this issue doesn't seem to have anything to do with VB Net itself or the mono-vbnc.

Could it be a part of AHMI dll that is causing this issue?

Which class is specifically opening the COM port for DF1 driver to send packet (currently I am testing DF1driver until I figure some other approach/driver)?
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on August 21, 2015, 12:29:52 PM
Here is the function that opens the COM port for the DF1 driver if you wanted to try to test it in a stand alone application:
Code: [Select]
   '*********************************
    '* Open Serial Port
    '*********************************
    Public Function OpenConnection() As Integer
        '*****************************************
        '* Open serial port if not already opened
        '*****************************************
        If Not SerialPort.IsOpen Then
            If m_BaudRate > 0 Then
                Try
                    SerialPort.PortName = m_ComPort

                    If m_BaudRate = 0 Then
                        DetectComSettings()
                    Else
                        SerialPort.BaudRate = m_BaudRate
                        SerialPort.Parity = m_Parity
                    End If


                    '* Calculate how long to wait based on baud rate
                    MaxWaitTicks = Convert.ToInt32(19200 * 100 / m_BaudRate)

                    SerialPort.ReceivedBytesThreshold = 1
                    SerialPort.Open()
                Catch ex As Exception
                    If SerialPort.IsOpen Then CloseConnection()
                    Return -9
                    'Throw New MfgControl.AdvancedHMI.Drivers.PLCDriverException("Failed To Open " & SerialPort.PortName & ". " & ex.Message)
                End Try
            Else
                Dim result As Integer = DetectComSettings()
                If result <> 0 Then
                    'Throw New MfgControl.AdvancedHMI.Drivers.PLCDriverException("Could Not Auto Connect")
                    If SerialPort.IsOpen Then CloseConnection()
                End If
                Return result
            End If
        End If

        Return 0
    End Function
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on August 21, 2015, 04:14:40 PM
I used older AHMI v3.84 to test this, modified your code to this and placed the call inside WaitForResponse sub of the DF1Comm driver:

Code: [Select]
    '*********************************
    '* Open Serial Port
    '*********************************
    Public Function OpenConnection() As Integer
        '*****************************************
        '* Open serial port if not already opened
        '*****************************************
        Dim SerialPort As New IO.Ports.SerialPort
        If Not SerialPort.IsOpen Then
            If CDbl(m_BaudRate) > 0 Then
                Try
                    SerialPort.PortName = m_ComPort

                    If CDbl(m_BaudRate) = 0 Then
                        DetectCommSettings()
                    Else
                        SerialPort.BaudRate = CInt(m_BaudRate)
                        SerialPort.Parity = m_Parity
                    End If

                    '* Calculate how long to wait based on baud rate
                    MaxTicks = Convert.ToInt32(19200 * 100 / CDbl(m_BaudRate))

                    SerialPort.ReceivedBytesThreshold = 1
                    SerialPort.Open()
                    MsgBox("Serial port opened")
                Catch ex As Exception
                    If SerialPort.IsOpen Then SerialPort.Close()
                    Throw New MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException("Failed To Open " & SerialPort.PortName & ". " & ex.Message)
                    Return -9
                    'Throw New MfgControl.AdvancedHMI.Drivers.PLCDriverException("Failed To Open " & SerialPort.PortName & ". " & ex.Message)
                End Try
            Else
                Dim result As Integer = DetectCommSettings()
                If result <> 0 Then
                    'Throw New MfgControl.AdvancedHMI.Drivers.PLCDriverException("Could Not Auto Connect")
                    If SerialPort.IsOpen Then SerialPort.Close()
                End If
                Return result
            End If
        End If

        Return 0
    End Function


When I run it on a Windows PC then I get this error (see the attached picture):

Quote
Comm Error -1.Failed To Open /dev/ttyUSB0. The given port name does not start with COM/com or does not resolve to a valid serial port. Parameter name: portName.


The same program run on Ubuntu PC gives this error (see the attached picture):

Quote
Comm Error -1.Failed To Open /dev/ttyUSB0. The requested feature is not implemented.


Another successful attempt was to place a ListBox on the form and place this code (the ports did open and close properly):

Code: [Select]
    Private mySerial As New SerialPort
    Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        listBoxSerialPorts.Items.Clear()
        Dim portnames As String() = SerialPort.GetPortNames()

        If portnames.Length = 0 Then
            Me.listBoxSerialPorts.Items.Add("error: none available!")
            listBoxSerialPorts.ForeColor = Color.Red
        Else
            listBoxSerialPorts.ForeColor = Color.Black
            For Each sPort As String In portnames
                Me.listBoxSerialPorts.Items.Add(sPort)
            Next
            If listBoxSerialPorts.Items.Count >= 1 Then
                listBoxSerialPorts.Sorted = True
            End If
        End If
    End Sub

    Private Sub listBoxSerialPorts_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles listBoxSerialPorts.SelectedIndexChanged
        If mySerial.IsOpen Then
            mySerial.Close()
            MsgBox("Serial Port " & mySerial.PortName & " closed.")
        End If
        mySerial.PortName = Me.listBoxSerialPorts.SelectedItem
        mySerial.BaudRate = 38400
        mySerial.DataBits = 8
        mySerial.Parity = Parity.None
        mySerial.StopBits = 2
        mySerial.Open()
        If mySerial.IsOpen Then MsgBox("Serial Port " & mySerial.PortName & " opened.")
    End Sub

    Private Sub MainForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        If mySerial.IsOpen Then
            mySerial.Close()
            MsgBox("Serial Port " & mySerial.PortName & " closed.")
        End If
    End Sub



Since I used older AHMI version for these tests, I can only suggest that you check that parameter portName as the first error suggested (if it is applicable in the current version).
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on August 21, 2015, 08:01:36 PM
Archie,

I am using MONO 3.2.8 on Ubuntu and it doesn't seem to like the line: SerialPort.ReceivedBytesThreshold.

That feature doesn't seem to be implemented.

Could you possibly comment it out and post a patched dll?

What I did find out is that if I copy debug folder to Home directory and run "mono AdvancedHMI.exe" directly from there instead of USB drive then the program seems to be trying to do something with the port (some "Win32 IO returned 25" errors disappeared but the program might be stuck on the above mentioned unsupported feature).
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Zip on August 21, 2015, 11:38:14 PM
That is the same error message that i have been getting.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on August 22, 2015, 12:52:30 AM
Maybe a separate MONO edition of AHMI could be created that would eliminate those features not implemented.

It all depends on how much work it would create for Archie.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Zip on August 29, 2015, 01:48:21 AM
Hi Godra,
               Please Excuse my lack of VB Coding Knowledge but I have been trying to find the sections of code where you modified the "Open Serial Port" commands and I cant find them anywhere in the Advanced HMI files. Am I missing something? Was hoping to replicate your successful attempt at getting the com port open. Could it be that the code is different in V3.98t to the v3.84 that you modified? Or am I looking in the wrong places? Browsed through all .vb files in the advanced HMI folder looking for "open serial port" and "WaitForResponse" but didnt come across anything. Apologies if this is a really basic Noob question.

zip
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on August 29, 2015, 04:09:27 AM
The code to open the serial port is actually a part of the dll file (which you cannot access).

Archie took it out and posted it in this topic so I could perform some testing.

I can only suggest to be patient and wait for Archie to possibly modify the code so it would work with serial ports on Pi.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Zip on August 29, 2015, 06:58:43 AM
Thanks Godra. I had a feeling that was the case. Thank you for confirming.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: welsche on January 21, 2016, 08:25:34 AM
Are there any news about Ahmi on the Raspberry with USB to Serial Adapter and Modbus RTU?
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: welsche on January 29, 2016, 05:29:31 AM
Push
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on January 29, 2016, 07:51:38 AM
Are there any news about Ahmi on the Raspberry with USB to Serial Adapter and Modbus RTU?
Internally we do very little development and testing with the Pi since it has almost no commercial applications for us, so unfortunately it is a very low priority. You may have better response on this by posing the question to a Raspberry Pi or Linux specific forum.

My guess is that it has something to do with Mono address serial ports in Linux versus the common Windows style of COMx:
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Zip on April 04, 2016, 09:03:40 AM
Quick update. Still no luck with modbus rtu but the brand of plc i use has just bought out an ethernet based model.
I was able to connect direct to the plc via ethernet port of raspberry pi for cheap standalone touchscreen hmi. Exactly what i needed! Thanks for all the help guys!
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: DanieLoche on July 12, 2016, 12:29:38 PM
Hello,

I juste made a little interface (2 buttons and a login page) to test it with my raspberry Pi. The goal is to implement a full HMI working in modbus TCP with a PLC.

But then when I try to run it, after 2 secondes AvcancedHMI.exe crashes.

Here is the error I get in the console :

Code: [Select]
* Assertion at mini-codegen.c:807, condition `i == sel' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at System.Windows.Forms.TextBoxBase.Draw (System.Drawing.Graphics,System.Drawing.Rectangle) <0x000ab>
  at System.Windows.Forms.TextBoxBase.OnPaintInternal (System.Windows.Forms.PaintEventArgs) <0x00063>
  at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message&) <0x0017f>
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message&) <0x00217>
  at System.Windows.Forms.TextBoxBase.WndProc (System.Windows.Forms.Message&) <0x00313>
  at System.Windows.Forms.TextBox.WndProc (System.Windows.Forms.Message&) <0x001d3>
  at System.Windows.Forms.Control/ControlWindowTarget.OnMessage (System.Windows.Forms.Message&) <0x0002b>
  at System.Windows.Forms.Control/ControlNativeWindow.WndProc (System.Windows.Forms.Message&) <0x0003b>
  at System.Windows.Forms.NativeWindow.WndProc (intptr,System.Windows.Forms.Msg,intptr,intptr) <0x002b7>
  at System.Windows.Forms.XplatUIX11.DispatchMessage (System.Windows.Forms.MSG&) <0x00023>
  at System.Windows.Forms.XplatUI.DispatchMessage (System.Windows.Forms.MSG&) <0x0002b>
  at System.Windows.Forms.Application.RunLoop (bool,System.Windows.Forms.ApplicationContext) <0x00ac7>
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext) <0x0005f>
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form) <0x0002b>
  at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun () <0x00083>
  at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run (string[]) <0x00023>
  at MfgControl.AdvancedHMI.My.MyApplication.Main (string[]) <0x0003f>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:


Debug info from gdb:

[New LWP 11418]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
0x76e3bee8 in __libc_waitpid (Cannot access memory at address 0x3
pid=11419, stat_loc=0x7efa8d10, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40
40 ../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
  Id   Target Id         Frame
  2    Thread 0x75bff430 (LWP 11418) "mono" 0x76e39a40 in do_futex_wait (isem=isem@entry=0x3181a4) at ../nptl/sysdeps/unix/sysv/linux/sem_wait.c:48
* 1    Thread 0x76f4a000 (LWP 11417) "mono" 0x76e3bee8 in __libc_waitpid (Cannot access memory at address 0x3
pid=11419, stat_loc=0x7efa8d10, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40

Thread 2 (Thread 0x75bff430 (LWP 11418)):
#0  0x76e39a40 in do_futex_wait (isem=isem@entry=0x3181a4) at ../nptl/sysdeps/unix/sysv/linux/sem_wait.c:48
#1  0x76e39af4 in __new_sem_wait (sem=0x3181a4) at ../nptl/sysdeps/unix/sysv/linux/sem_wait.c:69
#2  0x00219f98 in mono_sem_wait ()
#3  0x0019091c in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0x76f4a000 (LWP 11417)):
Cannot access memory at address 0x3
#0  0x76e3bee8 in __libc_waitpid (pid=11419, stat_loc=0x7efa8d10, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40
#1  0x000c0ba4 in ?? ()
Cannot access memory at address 0x3
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Aborted

Any idea ?
If needed I can provide my project.
I put the 3 folders in my USBkey (AdvancedHMI, AdvancedHMIControls, AdvancedHMIDrivers) and the project file.
Then I run : sudo mono AdvancedHMI.exe from AdvancedHMI/bin/debug/.
My project includes the modbus TCP driver (but unused), a SQL database for the login page and... nothing else special.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on July 12, 2016, 01:22:08 PM
Hello,

I juste made a little interface (2 buttons and a login page) to test it with my raspberry Pi. The goal is to implement a full HMI working in modbus TCP with a PLC.

But then when I try to run it, after 2 secondes AvcancedHMI.exe crashes.

Here is the error I get in the console :

Code: [Select]
* Assertion at mini-codegen.c:807, condition `i == sel' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at System.Windows.Forms.TextBoxBase.Draw (System.Drawing.Graphics,System.Drawing.Rectangle) <0x000ab>
  at System.Windows.Forms.TextBoxBase.OnPaintInternal (System.Windows.Forms.PaintEventArgs)
 
Any idea ?
This seems like a Mono/Winforms issue. Try creating a new Windows Form project in Visual Studio, add just a TextBox to the form, then see if you get the same problem.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: DanieLoche on July 13, 2016, 04:12:50 AM
Hello,

Yes I have the same issue. It looks like it's due to the text box... (it's the only thing that is not loaded before the application's crash)


Edit : after some researches I found some topics on the subject. There's an issue with versions under 3.10 of mono that could not handle textbox and its derivatives.

I'm having a hard time finding the tricks to update mono as apt-get gives me version 3.2...
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Mikefly95 on July 13, 2016, 10:54:44 AM
Has anyone tried Windows 10 IoT on the Pi with AHMI?
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on July 13, 2016, 01:42:58 PM
Has anyone tried Windows 10 IoT on the Pi with AHMI?
Windows 10 IoT requires UWP applications which is a different UI and framework. I have been gradually modifying the drivers so the will also work in UWP apps, but they are not quite there yet.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: DanieLoche on August 25, 2016, 06:47:07 AM
Hello,

Just wanted to give the following link, that gives clues about the issue using Modbus RTU on a Raspberry Pi (or more generally on any no-windows device, through mono).
http://stackoverflow.com/questions/7393818/serialport-in-mono-in-linux-not-responding-to-datareceived-event (http://stackoverflow.com/questions/7393818/serialport-in-mono-in-linux-not-responding-to-datareceived-event)

The issue is that mono do not handle the data received events for SerialPort. This post explains 3 ways to "solve" that.

Also, here are the related state of mono about Serial communication :
http://www.mono-project.com/archived/howtosystemioports/ (http://www.mono-project.com/archived/howtosystemioports/)
Indeed the ReceivedBytesThreshold method is not implemented and might be implemented manualy I suppose...
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Wayne on October 18, 2016, 11:12:36 PM
Has anyone tried Windows 10 IoT on the Pi with AHMI?
Windows 10 IoT requires UWP applications which is a different UI and framework. I have been gradually modifying the drivers so the will also work in UWP apps, but they are not quite there yet.

How's that coming ?  Dying to try AHMI on an R Pi 3 with their touchscreen and ModBus comms....................................
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on October 18, 2016, 11:29:48 PM
How's that coming ?  Dying to try AHMI on an R Pi 3 with their touchscreen and ModBus comms....................................
The ControlLogix driver for Widows10 IOT is in the works. But you can still use all of the current existing with the standard Pi image (Image) by using Mono.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Wayne on October 30, 2016, 11:48:39 PM
Looking to tap the infinite knowledge here...........

Have AHMI running on a R Pi 3 (running Raspian/Jessie).

Having a problem establishing comms between the Pi/AHMI app and the PLC via ModbusRTU.    Modbus RTU driver wants "Com1, 2, 3", but Pi/Raspbian doesn't define USB ports that way. 

Anyone have a solution to offer ?
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Wayne on November 01, 2016, 11:28:01 PM
@Archie
In the ModbusRTU definition, where the com port is declared, can ANY string be used there, or is it restricted to "COM1, COM2, etc." ?
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on November 02, 2016, 06:47:50 AM
@Archie
In the ModbusRTU definition, where the com port is declared, can ANY string be used there, or is it restricted to "COM1, COM2, etc." ?
The driver does not put any restrictions on the value, that value is passed directly to the SerialPort object:

https://msdn.microsoft.com/en-us/library/system.io.ports.serialport.portname(v=vs.110).aspx

According to this older Mono documentation, the SerialPort implementation is not complete which would cause the serial drivers to not work:

http://www.mono-project.com/archived/howtosystemioports/

Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Wayne on November 27, 2016, 11:27:45 AM
Archie;

Is there a chance that Mono has developed any further since the referenced article (2011) ?

I found this from 2013, but it's mostly Greek to me...............

http://antanas.veiverys.com/mono-serialport-datareceived-event-workaround-using-a-derived-class/

Wayne
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on November 27, 2016, 12:00:00 PM
Is there a chance that Mono has developed any further since the referenced article (2011) ?

I found this from 2013, but it's mostly Greek to me...............

http://antanas.veiverys.com/mono-serialport-datareceived-event-workaround-using-a-derived-class/
I really don't keep up with the Mono framework, so I'm not sure if anything has been changed. Since Microsoft bought Xamarin, that may have brought on some changes.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: robs745 on December 08, 2016, 12:51:38 PM
I have created a Dataliner using Advanced HMI 3.99 and it works great on my windows computer but i want to get it running on Raspberry Pi 3.  I ran through the steps from the beginning of this post but it doesn't want to work. The following is the response i get back from it:

root@raspberrypi:/home/pi/AdvancedHMI/bin/Debug# mono DataLiner.exe

Unhandled Exception:
System.InvalidOperationException: WinForms_SeeInnerException ---> System.InvalidProgramException: Method MfgControl.AdvancedHMI.MainForm:InitializeComponent () is too complex.
  at MfgControl.AdvancedHMI.MainForm..ctor () [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at MfgControl.AdvancedHMI.My.MyProject+MyForms.Create__Instance__[MainForm] (MfgControl.AdvancedHMI.MainForm Instance) [0x00000] in <filename unknown>:0
  at MfgControl.AdvancedHMI.My.MyProject+MyForms.get_MainForm () [0x00000] in <filename unknown>:0
  at MfgControl.AdvancedHMI.My.MyApplication.OnCreateMainForm () [0x00000] in <filename unknown>:0
  at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun () [0x00000] in <filename unknown>:0
  at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run (System.String[] commandLine) [0x00000] in <filename unknown>:0
  at MfgControl.AdvancedHMI.My.MyApplication.Main (System.String[] Args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: WinForms_SeeInnerException ---> System.InvalidProgramException: Method MfgControl.AdvancedHMI.MainForm:InitializeComponent () is too complex.
  at MfgControl.AdvancedHMI.MainForm..ctor () [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at MfgControl.AdvancedHMI.My.MyProject+MyForms.Create__Instance__[MainForm] (MfgControl.AdvancedHMI.MainForm Instance) [0x00000] in <filename unknown>:0
  at MfgControl.AdvancedHMI.My.MyProject+MyForms.get_MainForm () [0x00000] in <filename unknown>:0
  at MfgControl.AdvancedHMI.My.MyApplication.OnCreateMainForm () [0x00000] in <filename unknown>:0
  at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun () [0x00000] in <filename unknown>:0
  at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run (System.String[] commandLine) [0x00000] in <filename unknown>:0
  at MfgControl.AdvancedHMI.My.MyApplication.Main (System.String[] Args) [0x00000] in <filename unknown>:0
root@raspberrypi:/home/pi/AdvancedHMI/bin/Debug#[/color]

I would really appreciate it if anyone had any thoughts on what i could be doing wrong or if i need to change something to allow it to operate on raspberry pi.

Thanks
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on December 08, 2016, 01:09:00 PM
Check reply #46 to see if that might help remove any errors.

You should read all the posts in this topic since some might provide clues related to your setup.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: bachphi on December 10, 2016, 10:54:26 AM
Would a USB barcode scanner that act as a keyboard work on AAHMI-Pi ?  TIA.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: ShawnE on December 13, 2016, 01:28:21 PM
Hi All,

New here and I have a question. I am running a Ras Pi 3 w/ the official 7" touch screen. I have gotten OpenPlc and AHMI 3.99s running on it. I'm running AHMI under mono 3.2.8 and the latest Raspian Jesse. I see the same problem that you can see in the screenshot in the 1st post. The desktop bleeds through the background in the tank and pipe controls. I've tried all the variants of background images and fills on the main form and the individual components to no avail.

BTW, I don't see this behavior when running the solution on a Win7 machine. While I have an ugly workaround (make the main form a solid color and the desktop the same color with no icons) and can live with it if necessary, I was wondering if there might be a solution or if this is just a limitation of the way mono handles the transparency in the components.

Thanks,
Shawn
 
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on December 13, 2016, 07:00:28 PM
Since this "bleed through" is actually a problem with Mono and not AdvancedHMI, you may get better feedback from the Mono Winforms bug reporting:

http://www.mono-project.com/docs/gui/winforms/
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: ShawnE on December 14, 2016, 09:45:35 AM
Thanks Archie. That is what I thought. After searching the Mono Bugzilla, I didn't find a report that matched. I'm not going to do a bug report for an ancient Mono release. Since this is a hobby project, I'll go old school and not use any of your controls that have this issue. I can always draw something and use it as an image if I really need it.

As an aside, Mono is in the 4.xx series now, but mono-vbnc is broken against it. I really don't want to go through the change of life trying to build it against the new runtime. I think that I'll just concentrate on making OpenPlc talk to my external hardware and adding a Mqqt to Modbus-TCP gateway on the Pi.

AHMI and OpenPlc make a pretty cool and cheap stand alone controller. Thanks for releasing AHMI as a semi open source project.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: bachphi on December 26, 2016, 10:47:59 AM
Would a USB barcode scanner that act as a keyboard work on AAHMI-Pi ?  TIA.

I tried it with a USB  scanner, it works just fine!
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Rookie 2017 on April 12, 2017, 06:57:48 AM
tried using the original raspberry pi with the steps mentioned in the first post. Applications seems to load fine (first page has nothing but changeform buttons) but crashes after clicking the change form buttons going to the screens with the data displays.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on April 12, 2017, 05:43:22 PM
Rookie 2017,

Even though there is no question in your post, here is what you might consider:

1) Try reading all the posts to see what issues other users have experienced and if anyone offered any solution
2) Mono environment has lots of limitations and some AHMI controls might not work properly
3) Your screens with data displays might be causing the crash and not necessarily the FormChangeButton itself (to test this you can just try opening another blank form with the click of this button).
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: czeman on May 15, 2017, 03:32:19 PM
Are there any updates on the ability to run AdvancedHMI on a Pi using Windows 10 IoT? I saw something about the ControlLogix drivers not being quite there yet, but I'm talking to a Do-More processor using MODBUS.

Thanks! :)
Chris
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on May 18, 2017, 08:15:47 PM
Are there any updates on the ability to run AdvancedHMI on a Pi using Windows 10 IoT? I saw something about the ControlLogix drivers not being quite there yet, but I'm talking to a Do-More processor using MODBUS.
The full AdvancedHMI package running on Windows 10 IOT will most like not happen because only UWP will run on that OS. UWP has no well refined drag and drop designers as does Winforms. The UI has to be put together using XAML which diverts from the philosophy of AdvancedHMI which is being extremely easy to get started with.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: rob1970 on May 05, 2018, 04:58:03 AM
Hi. I'm trying to get AvancedHmi to run on a Raspberry pi 3. I installed Raspbain and managed to get mono installed (I think) but it still is not working. This is what I get when I try to run it.

The entry point method could not be loaded due to Could not load file or assembly 'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:(null) signature:<none>

Do you have an updated procedure to get this to work? Debian Wheezy is not listed for download anymore on the Pi website.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on May 05, 2018, 07:28:23 AM
Hi. I'm trying to get AvancedHmi to run on a Raspberry pi 3. I installed Raspbain and managed to get mono installed (I think) but it still is not working. This is what I get when I try to run it.

The entry point method could not be loaded due to Could not load file or assembly 'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:(null) signature:<none>

Do you have an updated procedure to get this to work? Debian Wheezy is not listed for download anymore on the Pi website.
It sounds like you did not get the vb extension installed with this step:

apt-get install mono-vbnc
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: seth350 on May 05, 2018, 10:58:21 PM
I would suggest that unless you have no other option, not to use a Raspberry and Mono.
Small Windows 10 PCs can be had for not much more money. Not to mention less pain.
Don’t get me wrong, AHMI will run fine on a RPi in Mono. However, Mono has its gotchas and you will be hard pressed to find support for a problem when you run into one.
The Mono community seems too caught up to release the next big update to help users with the current version. Especially if your problem is not “interesting”.

I have three RPis running Mono and AHMI. Out of all the issues, the one I deal with the most and have yet to solve is high cpu usage. It may not show up for a few weeks then one day the cpu will go to 100% and stay there until the app is restarted. This is only on the RPi.

Reminds me of that scene in Jurassic Park. “Nuh-uh-uuh! You didn’t say the magic word!”
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: rob1970 on May 08, 2018, 11:53:26 AM
I started over and reinstalled everything and it is running now so I must have missed something the first time. Thanks.

Title: Re: AdvancedHMI on a Raspberry Pi
Post by: yourpaltim on January 21, 2019, 04:46:09 AM
Here is how to run an AdvancedHMI application on a Raspberry Pi

1) Download the Debian Wheezy image
http://www.raspberrypi.org/downloads/



Hi there,

Is it essential that the Wheezy image is installed and not a more up to date version?

Thanks in Advance.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on January 21, 2019, 09:45:02 PM
Here is how to run an AdvancedHMI application on a Raspberry Pi

1) Download the Debian Wheezy image
http://www.raspberrypi.org/downloads/



Hi there,

Is it essential that the Wheezy image is installed and not a more up to date version?

Thanks in Advance.
I can only really offer the advice to try the other images and see if they work. As long as you can install Mono with WinForms, it should work.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: thegarlock on April 25, 2019, 11:46:15 AM
Here is how to run an AdvancedHMI application on a Raspberry Pi

1) Download the Debian Wheezy image
http://www.raspberrypi.org/downloads/



Hi there,

Is it essential that the Wheezy image is installed and not a more up to date version?

Thanks in Advance.

I've tested this using NOOBS to install Raspbian.  It works!  Wheezy is not required.  I released on .NET Framework 4.5 after reading a bit on mono.  I have not tested other versions of .NET.  Happy coding!
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: jsathern on November 28, 2019, 03:31:44 PM
Here is how to run an AdvancedHMI application on a Raspberry Pi

1) Download the Debian Wheezy image
http://www.raspberrypi.org/downloads/

2) Copy the image to the MicroSD card using Win32DiskImager
3) Install the card and boot up the Pi
4) When it gets to the configuration screen, set it to expand the image and also to boot to a Graphical User Interface
5) Select Finish in the configuration and Reboot
6) Once booted into the GUI, open a Command Prompt
7) Type these series of commands:

sudo su
apt-get update
apt-get install mono-complete
apt-get install mono-vbnc

8 ) Put in a memory stick with an AdvancedHMI application on it
9) In the command prompt, use the "cd" command to browse to the memory stick to the directory /bin/debug
10) mono AdvancedHMI.exe

In a few seconds the application should start.

There are a few things you may run into.

- You cannot use an OPC server because it is not a .NET application
- The MessageDisplayByValue may stop the application because it uses a speech library. There is a work around. Find System.Speech.DLL on your Windows PC and copy the file into the /bin/debug directory

Archie, you should add in here just for the new people like myself the following: You have to set up raspberry pi for a static ip address:

sudo nano /etc/dhcpcd.conf.
Type in the following lines on the top of the file: interface eth0 static ip_address=192.168.1.XX/24 static routers=192.168.1.1 static domain_name_servers=192.168.1.1.
sudo reboot.

Then Make sure the PLC and the Pi have the same (subnet?) first two numbers on the ip..............

I came across this writeup first and thought i would be set. I was wrong and it took me quite a while to figure this out. It would just be super helpful to have all the info in one place to get the pi and AHMI communicating.

Just a thought. thanks
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Phrog30 on November 30, 2019, 12:51:52 PM

Archie, you should add in here just for the new people like myself the following: You have to set up raspberry pi for a static ip address:


Why do you say static?  It has to be on the same subnet.  This is typical for any HMI, not just pi.  If you don't have DHCP server then you must setup manually.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on November 30, 2019, 01:10:30 PM
There is a lesser known utility on the Pi, that makes it easier:

> sudo raspi-config
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: jsathern on December 02, 2019, 08:28:11 PM
I'm new sorry.  :D did not know about the addressing
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: NaturallyAspirated on March 06, 2020, 05:34:45 PM
Here is how to run an AdvancedHMI application on a Raspberry Pi

1) Download the Debian Wheezy image
http://www.raspberrypi.org/downloads/

2) Copy the image to the MicroSD card using Win32DiskImager
3) Install the card and boot up the Pi
4) When it gets to the configuration screen, set it to expand the image and also to boot to a Graphical User Interface
5) Select Finish in the configuration and Reboot
6) Once booted into the GUI, open a Command Prompt
7) Type these series of commands:

sudo su
apt-get update
apt-get install mono-complete
apt-get install mono-vbnc

8 ) Put in a memory stick with an AdvancedHMI application on it
9) In the command prompt, use the "cd" command to browse to the memory stick to the directory /bin/debug
10) mono AdvancedHMI.exe

In a few seconds the application should start.

There are a few things you may run into.

- You cannot use an OPC server because it is not a .NET application
- The MessageDisplayByValue may stop the application because it uses a speech library. There is a work around. Find System.Speech.DLL on your Windows PC and copy the file into the /bin/debug directory
Well hot dog, I got this working!

This is my first foray into Raspberry Pi and AHMI, - I have been mostly an Arduino guy.

(https://www.nealmastel.com/FS/2020AHMIonPi.jpg)

I do have a question however, is there a connector, or way to harvest data from MySQL or an AWS RDS into AHMI directly?  I have the desire to have some direct device data, and some database data on AHMI.

Neal

Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on March 07, 2020, 06:06:14 PM
Just search this forum for "MySQL" and you will see some topics that had discussed it, like these ones:

https://www.advancedhmi.com/forum/index.php?topic=1641.0

https://www.advancedhmi.com/forum/index.php?topic=2291.0

https://www.advancedhmi.com/forum/index.php?topic=2129.0

Google will probably provide a bunch more info on MySQL and .Net usage.

Title: Re: AdvancedHMI on a Raspberry Pi
Post by: csam on May 28, 2020, 09:34:56 AM
Hello folks!!! Newbie here....

I see that @NaturallyAspirated is still using and has success on Archie's 2015 post.
Is there an updated version where a detailed step instruction are provided for an absolute green newbie like me?
Would appreciate any link. Thanks in advance...
 
Here is how to run an AdvancedHMI application on a Raspberry Pi

1) Download the Debian Wheezy image
http://www.raspberrypi.org/downloads/

2) Copy the image to the MicroSD card using Win32DiskImager
3) Install the card and boot up the Pi
4) When it gets to the configuration screen, set it to expand the image and also to boot to a Graphical User Interface
5) Select Finish in the configuration and Reboot
6) Once booted into the GUI, open a Command Prompt
7) Type these series of commands:

sudo su
apt-get update
apt-get install mono-complete
apt-get install mono-vbnc

8 ) Put in a memory stick with an AdvancedHMI application on it
9) In the command prompt, use the "cd" command to browse to the memory stick to the directory /bin/debug
10) mono AdvancedHMI.exe

In a few seconds the application should start.

There are a few things you may run into.

- You cannot use an OPC server because it is not a .NET application
- The MessageDisplayByValue may stop the application because it uses a speech library. There is a work around. Find System.Speech.DLL on your Windows PC and copy the file into the /bin/debug directory
Well hot dog, I got this working!

This is my first foray into Raspberry Pi and AHMI, - I have been mostly an Arduino guy.

(https://www.nealmastel.com/FS/2020AHMIonPi.jpg)

I do have a question however, is there a connector, or way to harvest data from MySQL or an AWS RDS into AHMI directly?  I have the desire to have some direct device data, and some database data on AHMI.

Neal


Title: Re: AdvancedHMI on a Raspberry Pi
Post by: NaturallyAspirated on June 27, 2020, 10:55:55 PM
Hello folks!!! Newbie here....

I see that @NaturallyAspirated is still using and has success on Archie's 2015 post.
Is there an updated version where a detailed step instruction are provided for an absolute green newbie like me?
Would appreciate any link. Thanks in advance...
 
I can help you walk though it.  It's pretty easy to do!

Neal
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: jrnoel11 on November 07, 2020, 10:36:58 PM
Dear Sirs

Could you help me to install AdvancedHMI application on my Raspberry pi 3+??
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Bhupesh on February 22, 2021, 01:27:50 AM
How to download AdvancedHMI.exe software to put it in RaspberryPi?
Kindly give me proper details with each and every step(How to go step by step)
So please reply ASAP.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on February 22, 2021, 05:09:08 AM
The first and most important step is that you start reading.

You can choose to go from the very first post of this topic (which would be recommended) or just scroll up to the reply #93 and you will see the steps.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Bhupesh on February 22, 2021, 06:04:28 AM
Where is an AdvacnedHMI.exe file or from where i can download it?
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on February 22, 2021, 06:38:18 AM
Where is an AdvacnedHMI.exe file or from where i can download it?
You don't download AdvancedHMI.exe , you use the base package to create your application

https://www.advancedhmi.com/index.php?main_page=product_info&cPath=2&products_id=20
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Bhupesh on February 22, 2021, 11:09:22 PM
How to start communication with Rpi from our Base Package and how can I check that rpi is responding?
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Archie on February 22, 2021, 11:50:32 PM
How to start communication with Rpi from our Base Package and how can I check that rpi is responding?
Have you read the quick start guide?
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Godra on February 23, 2021, 02:50:24 AM
Consider that RPi is just another computer.

You don't communicate with RPi at all, you only use it to load your finished application and run it from there.

You need to use the Base Package on a Windows based computer, create your application and, while creating it, can only test it with the direct connection to your PLC. Once you know it works, that is when you load it to the RPi and connect your PLC to the RPi as well.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: RubiksMan on April 07, 2022, 07:37:40 AM
Hi guys. I have got AHMI working on my Pi 4b 8Gb using Mono. The executable file loads fine and the HMI looks great so Mono definitely works well.

The issue I am having is with the Pi port labels. Unlike Windows which has easy "COM1" "COM2" etc it would seem that after a little bit of digging around the command lines on the Raspberry Pi my USB - RS485 cable seems to be attached to "ttyUSB0". However when I enter this port value into the properties box of the Modbus RTU driver and run it on the Pi it shows that "no such port address exists" ? . . . Any help would be most appreciated. Would love to get this to work on the Raspberry Pi.
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: Fito_IEBSA on June 16, 2022, 07:14:41 PM
Hi, sorry, what OS is the RPi working with?
Could you guide me how mono is installed in RPi
and what version
Title: Re: AdvancedHMI on a Raspberry Pi
Post by: mdhill on June 22, 2022, 02:03:16 PM
Afternoon.  I have my Advanced HMI project working on my raspberry Pi using Mono, but I have a question.  On my project,  I have modbus data coming from an Arduino Mega 2560 to the to the raspberry Pi via a single USB cable and using the ModbusRTUCom library to pass the data (/dev/ttyACM0).  I have two displays, but each has a different application on the screen and shares several registers from the modbus data.  Can both programs use the same ModbusRTUCom library to use on the different displays?