I've written a proram in 'C++' that accesses /dev/mem, the program works fine when run directly
on the Pi, either as root or with sudo.
I'm trying to run the program from my Windows 7 PC. When using tightvnc I get the following errors,
either as root or with sudo:-
I've tried, with no luck:-
Code: Select all
root@mypi:/home/pi# ./myprog X Error: BadAccess (attempt to access private resource denied) 10 Extension: 129 (MIT-SHM) Minor opcode: 1 (X_ShmAttach) Resource id: 0x2c00001 X Error: BadShmSeg (invalid shared segment parameter) 128 Extension: 129 (MIT-SHM) Minor opcode: 5 (X_ShmCreatePixmap) Resource id: 0x2c0000a X Error: BadDrawable (invalid Pixmap or Window parameter) 9 Major opcode: 62 (X_CopyArea) Resource id: 0x2c0000b X Error: BadDrawable (invalid Pixmap or Window parameter) 9 Major opcode: 62 (X_CopyArea) Resource id: 0x2c0000b * this last section repeats about 20 times
sudo chown root myprog
sudo chmod 4755 myprog
sudo chown 0:0 myprog
sudo chmod u+s myprog
If I connect to the Pi with MobaXterm using RDP and connect to my Pi's root account,
it works fine, but not if I connect to a user account and use sudo or a root terminal.
I have been advised to run a daemon on the pi and talk to that (I don't know how to do that).
Is there any thing else I can do to get the progam running from my Winows 7 PC with tightvnc?