Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2017-10-17 15:44:21

ad_t
Member
Registered: 2016-05-09
Posts: 52

PFC100 DbDrv

Hi,

I have just transferred my project from a Pi to a PFC100 an I am having trouble with the database driver. I am getting the errors below in RexView. I  have tried following the Debian Linux instructions for the installation of ODBC interface on the target device, from the DbDrv driver of the REX control system User guide, but it cannot find the rex-dbdrvt package. Do you have a guide to installing the drivers, or is there something else that is a problem?

2017-10-17;14:35:57.137;Error;DBDRV: connect to 'DRIVER=MySQL;SERVER=192.168.1.157;PORT=3306;DATABASE=sitecontrol;UID=*****;PWD=*****;;' failed!!!! ([01000] [unixODBC][Driver Manager]Can't open lib 'MySQL' : file not found);

2017-10-17;14:35:57.147;Error;DBDRV: connect to 'DRIVER=MSSQL;SERVER=192.168.1.155;PORT=1433;DATABASE=nfsrdz;UID=*****;PWD=*****;;' failed!!!! ([01000] [unixODBC][Driver Manager]Can't open lib 'MSSQL' : file not found);

Cheers,

Adam

Last edited by ad_t (2017-10-19 16:05:11)

Offline

#2 2017-10-20 09:00:26

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: PFC100 DbDrv

Hi Adam,
on the PFC100, everything is included in one package. The problem is with the ODBC driver for MSSQL. I'll have a look at it and I'll get back to you.

Best regards,
Jaroslav

Offline

#3 2017-10-20 16:34:37

ad_t
Member
Registered: 2016-05-09
Posts: 52

Re: PFC100 DbDrv

Thankyou Jaroslav

Offline

#4 2017-10-20 17:32:00

ad_t
Member
Registered: 2016-05-09
Posts: 52

Re: PFC100 DbDrv

Hi again,

A related problem to the above I think. The system is operational, but I am currently using dummy values where they would normally be read from the database. The system seemingly just crashed though (no response from device in review, and I see  the message 'eventmsg: unexpected stop of runtime' in the wago diagnostic log), after running overnight.

My gut feeling is it is because of all the the error messages in the rexcore log (I have left the database calls in the program, as it would be significant undertaking to remove them for now and add them back when the ODBC driver is working); I think I have had this before when I was getting a lot of errors during development.

Does it sound to you like this is what happened? If so is there a way to limit the rexcore log to store just the last n messages? If not, I will keep an eye on it and let you know any other details if it happens again.

Cheers,

Adam

Offline

#5 2017-10-25 14:41:54

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: PFC100 DbDrv

Dear Adam,
thanks for reporting this and sorry for any inconvenience resulting from the problem. The RexCore log is a cyclic buffer in memory and it is already limited to a few MB. Still it is very likely that the problem is related to the huge amount of error messages.

Can you please provide the following?

  • Was there RexDraw or RexView connected to the running device when it crashed?

  • Was there any HMI webpage open when it crashed?

  • Or any other device/program exchanging data with RexCore?

  • May I ask for the source codes of your project so we can try to replicate your setup here?

In any case, please try to watch free memory and disk space whether the system is running out of it or not.

Kind regards,
Jaroslav

Offline

#6 2017-10-25 23:56:42

ad_t
Member
Registered: 2016-05-09
Posts: 52

Re: PFC100 DbDrv

Hi Jaroslav,

In answer to your questions:

- The was not an instance of RExDraw or RexView connected to the device as far as I know
- There may well have been a HMI webpage open
- The device was communicating with 3 other devices via Modbus over TCPIP

I am happy to send you a copy of the project, I just request it is not shared outside of Rex Controls. I have sent it the support@rexcontrols.com address for your attention.

Have you had any progress with the ODBC driver for MSSQL?

Thank you very much for your help on this.

Regards,

Adam

Offline

#7 2017-11-01 20:02:59

ad_t
Member
Registered: 2016-05-09
Posts: 52

Re: PFC100 DbDrv

Hi Jaroslav,

Have you had any luck with with ODBC driver for MSSQL/MYSQL yet? Is there any more information I can send over to help?

Cheers,

Adam

Offline

#8 2017-11-02 12:40:34

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: PFC100 DbDrv

Dear Adam,
our developers are on it. I'm sorry it takes so long. I'll let you know as soon as I have some news. Thanks for understanding.

Kind regards,
Jaroslav

Offline

#9 2017-11-02 13:50:25

ad_t
Member
Registered: 2016-05-09
Posts: 52

Re: PFC100 DbDrv

Thank you Jaroslav, sorry for pestering you.

Adam

Offline

#10 2017-11-03 17:05:55

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: PFC100 DbDrv

Hello Adam,

there are missing libraries for connection to particular databases. In order to use our ODBC driver for MSSQL you need to install FreeTDS library and also configure unixODBC connector as follows:

1. wget http://download.rexcontrols.cz/reposito … 67_arm.ipk
2. ipkg install freetds_1.00.67_arm.ipk
3. nano /etc/odbcinst.ini
4. Add following lines to the file (should be blank at the beginning):
[MSSQL]
Description=Microsoft SQL (FreeTDS) Driver
Driver=libtdsodbc.so

Now you should be able to connect to your database using REX. Let me know If you find any difficulties.
Do you also plan to connect to any other database?

Regards, Tomas

Last edited by jaroslav_sobota (2017-11-08 08:25:40)

Offline

#11 2017-11-07 16:21:53

ad_t
Member
Registered: 2016-05-09
Posts: 52

Re: PFC100 DbDrv

Hi Tomáš,

Thank you very much for that. I will give it a go and let you know how I get on.

The project also involves connections to a mySQL database as well, if you are able to help me with the libraries for that as well I would be very appreciative.

Cheers,

Adam

Offline

#12 2017-11-08 01:13:03

ad_t
Member
Registered: 2016-05-09
Posts: 52

Re: PFC100 DbDrv

Hi Tomáš,

Thank you again for sorting out the drivers. I have installed them and the MSSQL side of things is now working perfectly.

One note for the people like me reading this in the future who are not fully fluent in Linux, line 2 of the instructions above should read:

2. ipkg install freetds_1.00.67_arm.ipk - FIXED

Thank you again, and as ever your support is excellent and very much appreciated.

Adam

Last edited by jaroslav_sobota (2017-11-08 08:28:37)

Offline

#13 2017-11-08 08:27:10

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: PFC100 DbDrv

Hi Adam,
thanks for reporting this. I have fixed it in the post above.

Best regards,
Jaroslav

Offline

#14 2017-11-10 11:26:58

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: PFC100 DbDrv

Hi Adam,

MySQL connection on WAGO is fixed. Please, follow the instructions below:

1. wget http://download.rexcontrols.cz/reposito … .2_arm.ipk
2. ipkg install mdbodbc_3.0.2_arm.ipk
3. nano /etc/odbcinst.ini
4. Add following lines to the file:
[MySQL]
Driver = libmaodbc.so
Description = MariaDB Connector/ODBC v.3.0

Hope it helps.

Cheers, Tomas

Offline

#15 2018-01-13 17:19:06

ad_t
Member
Registered: 2016-05-09
Posts: 52

Re: PFC100 DbDrv

Hi Tomas,

Happy New Year to you and everyone at Rex. i had to work on other projects for a while, so have only just had a chance to implement a MySQl connection.

I followed your instructions, but unfortunately I am getting the following errors, and no data is being input into my database; it appears to not be able to find 'libmaobdc.so'. do you have any suggestions?

2018-01-13;16:13:32.889;Error;Server: Connection from [::ffff:192.168.1.157]:51120 finished with error: Timeout (-102);
2018-01-13;16:13:56.359;Error;Server: Connection from [::ffff:192.168.1.157]:51123 finished with error: Timeout (-102);
2018-01-13;16:14:05.929;Error;DBDRV: connect to 'DRIVER=MySQL;SERVER=192.168.1.157;PORT=3306;DATABASE=sitecontrol;UID=BMS;PWD=****************;;' failed!!!! ([01000] [unixODBC][Driver Manager]Can't open lib 'libmaobdc.so' : file not found);

Thanks,

Adam

Offline

#16 2018-01-15 16:29:32

stetina
REX developer
From: Pilsen, Czech Republic
Registered: 2015-10-29
Posts: 9

Re: PFC100 DbDrv

Hi Adam,
Key problem seems be " 'libmaobdc.so' : file not found". Possible reasons are:
1. Check, if file is on your WAGO (e.g. if instalation in point 2 of Tomas list not failed). On my computer it is in directory /usr/lib/odbc.
2. Try write references on this file into odbcinst.ini with whole path, e.g.
          Driver = /usr/lib/odbc/libmaodbc.so
instead
          Driver = libmaodbc.so

3. Install latest version of llibrary, e.g.
wget http://download.rexcontrols.cz/reposito … .2_arm.ipk
ipkg install mdbodbc_3.0.2_arm.ipk

Regards,
Milan Stetina

Offline

#17 2018-01-22 14:34:16

ad_t
Member
Registered: 2016-05-09
Posts: 52

Re: PFC100 DbDrv

Thank you for your reply Milan,

It seems the directory /usr/lib/odbc (or any odbc directory) does not exist on my WAGO. I have tried installing the latest version of the library again, but am finding the same thing. Is there something obvious I am missing as to why the directory isn't being created?

Regards,

Adam

Offline

#18 2018-02-05 17:18:32

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: PFC100 DbDrv

Hi Adam,
sorry for the delay. On my PFC200 the libmaodbc.so file is located directly in /usr/lib directory. Please check it with
ls /usr/lib/libmaodbc.*

Putting
Driver = /usr/lib/libmaodbc.so
into /etc/odbcinst.ini does the trick for me.

Let me know.

Kind regards,
Jaroslav

Offline

#19 2018-02-17 19:48:12

ad_t
Member
Registered: 2016-05-09
Posts: 52

Re: PFC100 DbDrv

Hi Jaroslav,

Thank you for that, it worked.

All the best,

Adam

Offline

#20 2018-02-19 07:21:20

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: PFC100 DbDrv

Hi Adam,
thanks for your message. Glad I could help.

Kind regards,
Jaroslav

Offline

Board footer

Powered by FluxBB