You are not logged in.
Pages: 1
Topic closed
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
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
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Thankyou Jaroslav
Offline
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
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
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
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
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
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
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Thank you Jaroslav, sorry for pestering you.
Adam
Offline
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
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
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
Hi Adam,
thanks for reporting this. I have fixed it in the post above.
Best regards,
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
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
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
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
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
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
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Hi Jaroslav,
Thank you for that, it worked.
All the best,
Adam
Offline
Hi Adam,
thanks for your message. Glad I could help.
Kind regards,
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Pages: 1
Topic closed