JM K
Forum Replies Created
-
AuthorPosts
-
JM KParticipant
Hi,
I am not able to enable php with lighttpd because mod_fastcgi.so is missing in
the extension directory
Restarting lighttpd web server : no /usr/sbin/lighttpd found: none killed
2011-11-27 16:55:30: (plugin.c.165) dlopen() failed
for: /usr/lib/mod_fastcgi.so /usr/lib/mod_fastcgi.so:
cannot open shared object file: No such file or directory
2011-10-27 16:55:30: (server.c.621) loading plugins finally failed
This was after I bitbaked ‘fastcgi’ and did an scp to the CDP.
Someone was of the opnion that ‘lighttpd-fastcgi’ was supposed to be installed as a separate package in Fedora. I did try to install a package ‘lighttpd-module-fastcgi’ that existed in the armv5te folder but could not scp it to the CDP. Is this the missing package that has the missing .so file?
I would appreciate any suggestions/advice on how to solve this one. Thank you and have a great day.
Best Regards,
JM
JM KParticipantHi Rishi,
Wow! Might have been sort of a ‘double time effort’ for the initial build. Nice to hear from another developer working on the CDP. If you do not mind my asking, are you by any chance from India? Reason that I asked is just wanted to know if the CDP is popular in India with regard to employment opportunities for developers.
Best Regards,
JM
JM KParticipantLooks like I’ve found it. It is the same as php.ini-recommended I think.
JM KParticipantI do vaguely remember having seen both a folder called php5 in the openembedded/recipes/ folder containing the php.ini file. Somehow it no longer exists after I bitbaked php. Is there a way to reverse this? I would very much appreciate your suggestions. Thank you and have a great day.
Best Regards,
JM
JM KParticipantDear Jesse,
thank you very much for your advice/suggestion. Is there any restriction with regard to the TCP server port (Can I use port 23 for instance?) that the lighttpd should listen? I think port 22 is used to ssh to the CDP yes? I am trying to get a better idea by going through some example config files for lighttpd. Also I bitbaked both lighttpd as well as php. Somehow I am not able to find php.ini in the recipes/php/ folder to configure it. Thank you and have a great day.
Best Regards,
JM
JM KParticipantHi Rishi,
it took me almost three hours if I remember right for the initial build.
http://www.multitech.net/developer/products/multiconnect-ocg/getting-started/
As long as you don’t see any errors I think it ought to be fine. I think Ubuntu 10.04 is the best. Are you working on the CDP?
Regards,
JM
JM KParticipantHi Rishi,
what version of Ubuntu are you running?
JM KParticipantHi,
Lonny, thanks for the response. Can you suggest me any websites or documentation where I can learn more on developing Embedded HTTP Servers for ARM based systems? Thank you and have a great day.
Best Regards,
JM
JM KParticipantHi,
thanks for your response, Lonny. I have gone through a couple of websites and some of them seemed to suggest that Cherokee was a pretty good web server. For the server side it requires PHP and Mysql. I am trying to understand the concept of implementation. So the user interface is in reality a web browser which relays the information to the web server. The server side program in PHP relays this request to the C program on the CDP and the response is sent through to the web browser again. The web browser is built from Dynamic HTML code that resides in the CDP. What purpose does the Mysql serve? Please correct me if my understanding is not correct and I would appreciate it if my question is answered. Thank you very much and have a great weekend.
Best Regards,
JM
JM KParticipantHi Lonny,
thank you for the response. Can you give me sort of an example how that would work? Would the user interface be like a webpage something that would resemble an Embedded Ethernet Device Server ? Thank you and have a great day.
Best Regards,
JM
JM KParticipantDear Jesse,
Thanks a lot. Your advice/suggestion worked like a charm! Thanks again.
Best Regards,
JM
JM KParticipantDear Lonny and Jesse, thanks for the response. I tested the serial port. Works fine.
Best Regards,
JM
October 6, 2011 at 10:02 pm in reply to: Request for suggestion regarding Modbus Communication #3351JM KParticipantDear Brandon,
thanks for the response. I got it to work.
Best Regards,
JM
JM KParticipantDear Jesse,
Thank you very much. I could successfully bitbake my application.
Best Regards,
JM
JM KParticipantI figured it out. The library just has to be installed as a bitbake package.
JM KParticipantHi Jesse,
I figured out how to set the path. I am trying to set the path in the makefile however and I have been unsuccessful in doing this so far. In case I issue a command as this:
$arm-corecdp-linux-gnueabi-gcc -lmodbus mymodbuscomm.c -o mymodbuscomm
I encounter no errors nor does the command return anything.
Neither is there a generation of a new .o file in the same folder does it mean the program compiled successfully? Thanks for your help.
Best Regards,
JM
JM KParticipantHi Jesse,
Thanks for the response. I opened up the devshell by issuing the command:
bitbake modbuscomm -c devshell
Then at the command prompt I isuued the command:
arm-corecdp-linux-gnueabi-gcc -lmodbus mymodbuscomm.c -o mymodbuscomm
It returned nothing neither did any compilation errors show up. Then I exited the devshell and wrote a simple makefile.
CC = $OETREE/build/tmp/cross/armv5te/bin/arm-corecdp-linux-gnueabi-gcc
mymodbuscomm: mymodbuscomm.c
arm-corecdp-linux-gnueabi-gcc -lmodbus mymodbuscomm.c -o mymodbuscomm
Then I changed my bitbake recipe in the way where under do_compile only makefile existed.
Then when I tried to package using bitbake modbuscomm at the prompt the following error showed up:
Log data follows:
| /home/jm/Desktop/corecdp-1.1.1/build/tmp/work/armv5te-corecdp-linux-gnueabi/modbuscomm-1.0.0-r104/temp/run.do_compile.15178: line 784: makefile: command not found
| ERROR: Function do_compile failed
When I tried just issuing make at the command prompt the following error showed up:
arm-corecdp-linux-gnueabi-gcc -lmodbus mymodbuscomm.c -o mymodbuscomm
make: arm-corecdp-linux-gnueabi-gcc: Command not found
make: *** [mymodbuscomm] Error 127
Why did the same command at the devshell return nothing? Does the PATH in the env-oe.sh have to be modified? I checked and made sure that the relevant headers (modbus.h) exited in the include folder. I would appreciate it if my questions are answered. Thanks a lot, Jesse.
Best Regards,
JM
JM KParticipantDear Jesse,
thanks for the response. I issued this command at the prompt while having navigated to the folder that had my application:
gcc mymodbuscomm.c -I/usr/include -L/usr/lib -lmodbus
Then I noticed that a a.out file got generated in the same folder.
Following your advice I opened up a development shell by running:
bitbake modbuscomm -c devshell then at the command prompt issued the same command again:
jm@jm-desktop:~/Desktop/corecdp-1.1.1/build/tmp/work/armv5te-corecdp-linux-gnueabi/modbuscomm-1.0.0-r100$ gcc mymodbuscomm.c -I/usr/include -L/usr/lib -lmodbus
I got these errors:
mymodbuscomm.c:4: error: expected identifier or ‘(‘ before string constant
mymodbuscomm.c:5:19: error: modbus.h: No such file or directory
mymodbuscomm.c: In function ‘main’:
mymodbuscomm.c:14: error: ‘modbus_t’ undeclared (first use in this function)
mymodbuscomm.c:14: error: (Each undeclared identifier is reported only once
mymodbuscomm.c:14: error: for each function it appears in.)
mymodbuscomm.c:14: error: ‘ctx’ undeclared (first use in this function)
I found that the problem I am facing has been faced by others however they were using the eclipse C/C++ IDE and I found both the problem and the solution:
http://cboard.cprogramming.com/c-programming/136664-undefined-reference.html (please check the link)
Solution is:
“Thanks to all who have helped. I think that I have found the solution to the issue. As Tater said, there seems to be a library file with a .la extension or maybe the file that has .pc extension. For a newbie I am not sure why this file is needed at all because you have functions and header files which all of the logic seems to be there for everything to work with just the header files and the functions defined within them. In eclipse I right clicked on the project file then expanded the “C/C++ Build” then went to “settings” then expanded the “GCC C Linker” then went to “Libraries” then went under “Libraries (-l)” and added “modbus” it seemed to work. I am guessing that the default location for this to search is /usr/local/lib/pkgconfig which contained the file modbus.pc . Although I also changed the file name in eclipse libmodbus to test because I also have a file in /usr/local/lib called libmodbus.la and I don’t get any errors with this either. Hope this helps someone in the future so they don’t waste the 3.5 hours I did. Anybody to further explain for myself and other newbies would be appreciated I am sure.” (Credit to the user who posted this one).
I am wondering how to replicate the same in this case. I apologize if my questions are too trivial as I am a beginner with not much experience in programming applications on a Linux platform.
Thank you and have a great day.
Best Regards,
JM
September 29, 2011 at 10:36 pm in reply to: Request for suggestion regarding Modbus Communication #3349JM KParticipantHi,
I am posting my question again. Please disregard my previous post (question).
I am trying to communicate with a plc which is a modbus slave through a C program. The program just opens and closes the connection as I basically wanted to test this function first before I proceeded any further:
# include “stdio.h”
# include “stdlib.h”
# include “modbus/modbus.h”
#define plc 0x01
int main(void)
{
modbus_param_t mb_param;
modbus_init_rtu(&mb_param,”/dev/ttyS2″,”none”,8,1);
if (modbus_connect(&mb_param) == -1) {
printf(“Not connectedn”);
exit(1);
}
modbus_close(&mb_param);
}
When I compile this program, I am faced with errors:
mymodbuscomm.c: In function ‘main’:
| mymodbuscomm.c:9: error: ‘modbus_param_t’ undeclared (first use in this function)
| mymodbuscomm.c:9: error: (Each undeclared identifier is reported only once
| mymodbuscomm.c:9: error: for each function it appears in.)
| mymodbuscomm.c:9: error: expected ‘;’ before ‘mb_param’
| mymodbuscomm.c:12: error: ‘mb_param’ undeclared (first use in this function)
| ERROR: Function do_compile failed
My bitbake recipe is as follows:
DESCRIPTION = “modbuscomm”
SECTION = “examples”
LICENSE = “GPL”
PR = “r12”
SRC_URI = “file://mymodbuscomm.c
file://modbus.c
file://modbus.h
file://modbus-data.c
file://modbus-rtu.c
file://modbus-rtu.h
file://modbus-tcp.c
file://modbus-tcp.h”
S = “${WORKDIR}”
do_compile() {
${CC} ${CFLAGS} ${LDFLAGS} mymodbuscomm.c -o mymodbuscomm
${CC} ${CFLAGS} ${LDFLAGS} modbus.c -o modbus
${CC} ${CFLAGS} ${LDFLAGS} modbus-data.c -o modbus-data
${CC} ${CFLAGS} ${LDFLAGS} modbus-rtu.c -o modbus-rtu
${CC} ${CFLAGS} ${LDFLAGS} modbus-tcp.c -o modbus-tcp
}
do_install() {
install -d ${D}${bindir}
install -m 0755 mymodbuscomm ${D}${bindir}
install -m 0755 modbus ${D}${bindir}
install -m 0755 modbus-data ${D}${bindir}
install -m 0755 modbus-rtu ${D}${bindir}
install -m 0755 modbus-tcp ${D}${bindir}
}
Any further suggestions on how to go about solving these errors or any suggestions regarding changes to the bitbake recipe would be very much appreciated. Thank you and have a great day.
Best Regards,
JM
September 28, 2011 at 6:01 pm in reply to: Request for suggestion regarding Modbus Communication #3348JM KParticipantDear Kevin, Jesse Gilles and Brandon Pedersen. I wanted to take this opportunity to Thank you all for your invaluable suggestions.
Brandon,
thanks a lot for your help. I have written a successful recipe that accomplished the task of creating the modbus.h file in the usr/include directory. I have included modbus.h as a header file as I felt it’d be much easier for application development.
I do have another question related to bitbake. If I wanted to compile more than one file would I write a recipe like this? (here modbuscomm.c and modbus-rtu.c are the two files to be compiled) :
DESCRIPTION = “modbuscomm”
SECTION = “examples”
LICENSE = “GPL”
DEPENDS = “libesmtp libyaml”
PR = “r12”
SRC_URI = “file://mymodbuscomm.c
file://modbus-rtu.c
file://modbus-rtu.h “
S = “${WORKDIR}”
do_compile() {
${CC} ${CFLAGS} ${LDFLAGS} mymodbuscomm.c -o mymodbuscomm
${CC} ${CFLAGS} ${LDFLAGS} modbus-rtu.c -o modbus-rtu.c
}
do_install() {
install -d ${D}${bindir}
install -m 0755 mymodbuscomm ${D}${bindir}
install -m 0755 modbus-rtu ${D}${bindir}
}
I would appreciate it if you could let me know whether this recipe is good. Have a great day.
Best Regards,
JM
JM KParticipantHi Lonny,
I apologize for complicating such a trivial problem. I think I have it all figured out. Thanks for your help.
Best Regards,
JM
JM KParticipantDear Lonny,
thank you very much for the response. The PLC is a standard DTE interface with the following pin out on the serial interface:
Pin # Description
1 RS232 Power in
2 GND
3 TXD
4 RXD
5 GND
6 RS232 Power in
Input voltage range 5-15V (RS232 positive voltage)
I think it could be possible to construct my own cable, yes? I am a bit confused about the RS232 power pins on the schematic of the CDP that I received yesterday. Thanks again for your help. I would appreciate it if you could let me know any suggestions on the pin out for the new cable.
Best Regards,
JM
September 19, 2011 at 10:04 pm in reply to: Request for suggestion regarding Modbus Communication #3346JM KParticipantDear Brandon,
thank you very much. I managed to successfully build libmodbus using bitbake. Another question I have is after a successful build how do I proceed with including the library, libmodbus in my C program? How to install it as a library that can run on the ARM platform? I would very much appreciate if you could let me know how to go about it. Thank you very much and have a great day.
Best Regards,
JM
September 16, 2011 at 5:06 pm in reply to: Request for suggestion regarding Modbus Communication #3345JM KParticipantHi Brandon,
thank you very much for your response. I modified the .bb file as per your suggestion however I got another error when I tried to bitbake libmodbus.
Here is the response I got:
jm@jm-desktop:~/Desktop/corecdp-1.1.1$ bitbake libmodbus
NOTE: Handling BitBake files: / (7982/7982) [100 %]
Parsing of 7982 .bb files complete (7672 cached, 310 parsed). 7723 targets, 327 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
ERROR: TaskFailed event exception, aborting
ERROR: Build of /home/jm/Desktop/corecdp-1.1.1/user-collection/recipes/libmodbus/libmodbus_3.0.1.bb do_setscene failed
NOTE: Preparing runqueue
NOTE: Executing runqueue
NOTE: Running task 280 of 448 (ID: 1, /home/jm/Desktop/corecdp-1.1.1/user-collection/recipes/libmodbus/libmodbus_3.0.1.bb, do_setscene)
ERROR: Task 1 (/home/jm/Desktop/corecdp-1.1.1/user-collection/recipes/libmodbus/libmodbus_3.0.1.bb, do_setscene) failed with 256
ERROR: ‘/home/jm/Desktop/corecdp-1.1.1/user-collection/recipes/libmodbus/libmodbus_3.0.1.bb’ failed
NOTE: package libmodbus-3.0.1-r15.15: task do_setscene: Started
ERROR: Function staging_helper failed
NOTE: Task failed: (‘function staging_helper failed’, ‘/home/jm/Desktop/corecdp-1.1.1/build/tmp/work/armv5te-corecdp-linux-gnueabi/libmodbus-3.0.1-r15.15/temp/log.staging_helper.13547’)
ERROR: Logfile of failure stored in: /home/jm/Desktop/corecdp-1.1.1/build/tmp/work/armv5te-corecdp-linux-gnueabi/libmodbus-3.0.1-r15.15/temp/log.staging_helper.13547
Log data follows:
| /home/jm/Desktop/corecdp-1.1.1/build/tmp/work/armv5te-corecdp-linux-gnueabi/libmodbus-3.0.1-r15.15/temp/run.staging_helper.13547: line 909: syntax error near unexpected token `else’
| ERROR: Function staging_helper failed
NOTE: package libmodbus-3.0.1-r15.15: task do_setscene: Failed
ERROR: TaskFailed event exception, aborting
ERROR: Build of /home/jm/Desktop/corecdp-1.1.1/user-collection/recipes/libmodbus/libmodbus_3.0.1.bb do_setscene failed
ERROR: Task 1 (/home/jm/Desktop/corecdp-1.1.1/user-collection/recipes/libmodbus/libmodbus_3.0.1.bb, do_setscene) failed with 256
ERROR: ‘/home/jm/Desktop/corecdp-1.1.1/user-collection/recipes/libmodbus/libmodbus_3.0.1.bb’ failed
ERROR: ‘/home/jm/Desktop/corecdp-1.1.1/user-collection/recipes/libmodbus/libmodbus_3.0.1.bb’ failed
jm@jm-desktop:~/Desktop/corecdp-1.1.1$
I modified the filename of the libmodbus_2.0.3.bb to libmodbus_3.0.1 (as 3.0.1 is the latest version of libmodbus) as well as PV = “3.0.1+git${SRCPV}”. I also made sure that I incremented INC_PR each time I bitabked libmodbus along with incrementing PR = “$INC_PR}.x” (where x is the numerical increment). Any suggestions would be very much appreciated. Thank you and have a great day.
Best Regards,
JM
September 14, 2011 at 10:36 pm in reply to: Request for suggestion regarding Modbus Communication #3343JM KParticipantHi Jesse,
thank you very much for the link. When I tried to build libmodbus with the .bb files on the link somehow I have been getting a check sum error. I think I will contact the author of libmodbus on this one. I appreciate your help.
Regards,
JM
JM KParticipantHi Jesse,
you are correct. I completely forgot that it has to get cross compiled to run on the cdp. Thanks for the response.
Regards,
JM
September 13, 2011 at 10:42 pm in reply to: Request for suggestion regarding Modbus Communication #3341JM KParticipantHi Jesse,
thank you very much for your response. I have so far been unsuccessful in my search for a compatible bitbake recipe however I will continue to search further. I would very much appreciate it if you could let me know any recipe that you might have across in the repository that could be used to build libmodbus.
Regards,
JM
September 9, 2011 at 10:47 pm in reply to: Request for suggestion regarding Modbus Communication #3339JM KParticipantHi,
I have come across this modbus library, ‘libmodbus’. I have compiled and installed it on my system. The header file is located in /usr/local/include/modbus. I am using C to develop my code and my header files are located in corecdp-1.1.1/build/tmp/staging/armv5te-corecdp-linux-gunueabi/usr/include. I am confused as how to link the former header file (modbus). In order to bitbake my application successfully do I need to install libmodbus in this location(corecdp-1.1.1/build/tmp/staging/armv5te-corecdp-linux-gunueabi/usr/include)? I would very much appreciate it if someone could answer my question.
September 7, 2011 at 5:41 pm in reply to: Request for suggestion regarding Modbus Communication #3338JM KParticipantDear Kevin,
Thank you for the response. I am looking at Modbus communication from point to point. The PLC I am trying to use supports RS232. I would very much appreciate it if you could let me know of a few popularly used open source Modbus protocol libraries.
Best Regards,
JM
JM KParticipantHi Sebastian,
Try copying the the .smsconfig file using the scp to the device. Make sure that it is in the /home/root directory. After having copied the file, use your editor vi or nano to view and confirm it. Then try issuing the sms-send command.
Regards,
JM
-
AuthorPosts