Go to advanced search

by mutley
Thu Dec 08, 2016 7:35 pm
Forum: C/C++
Topic: Any "fopen for write" with owner-params?
Replies: 4
Views: 1196

Re: Any "fopen for write" with owner-params?

open (not fopen) will allow you to set permissions of the file.
setuid will allow you to set the uid of the process.

So, as an example (from memory not tested)

setuid(501) // assuming www-data is 501
fd = open(filename, O_RDRW | O_CREAT, 0644)
by mutley
Thu Oct 27, 2016 10:41 pm
Forum: General discussion
Topic: Webserver - how do I set a nice address?
Replies: 11
Views: 5210

Re: Webserver - how do I set a nice address?

... but isn't avahi-daemon a Bonjour implementation for linux? i.e. it will only work with Apple products? Bonjour has been a integral part of Windows since Win7 (or possibly earlier) even though it was invented by Apple. Avahi and Apple's Bonjour (originally named Rendezvous) are both implementati...
by mutley
Thu Oct 27, 2016 2:25 pm
Forum: General discussion
Topic: Webserver - how do I set a nice address?
Replies: 11
Views: 5210

Re: Webserver - how do I set a nice address?

If the RPi is running avahi-daemon then http://pi.local/ should "just work". You could tweak the avahi-daemon config to change the second part of that name. You can change the first part of that name in sudo raspi-config (it uses the hostname). I was thinking of an easier way to do this than runnin...
by mutley
Thu Oct 27, 2016 2:20 pm
Forum: General discussion
Topic: Webserver - how do I set a nice address?
Replies: 11
Views: 5210

Re: Webserver - how do I set a nice address?

As you stated, you need to modify what ever is servicing DNS for this network. You state it's connecting to a router, so this is probably what's doing name resolution for you. BUT :- Most routers do not do DNS, they simply forward the request onto your ISP's DNS server. Since you said there is no in...
by mutley
Tue Oct 25, 2016 9:47 pm
Forum: C/C++
Topic: How...C/C++ code that SSHs into another Pi to run a program?
Replies: 9
Views: 2761

Re: Elescalador

Thanks, those are interesting and, while I'd use them if that's the only way I can figure out, my entire Raspberry Pi career has been dedicated to learning c/c++. If it's possible I'll do it the hard way to learn new tricks with these. Then I would highly recommend you take a look at writing a basi...
by mutley
Tue Oct 25, 2016 8:29 pm
Forum: General discussion
Topic: Which components of a Pi have unique serial numbers..?
Replies: 31
Views: 4073

Re: Which components of a Pi have unique serial numbers..?

<snip> This is ignoring anything printed on the outside of a component, I have no idea about that. Nice that you are playing third party again. How many profiles did you make up this week? More unfounded accusations, I've been a member for close to a year, please grow up. https://www.raspberrypi.or...
by mutley
Mon Oct 24, 2016 3:15 pm
Forum: General discussion
Topic: Which components of a Pi have unique serial numbers..?
Replies: 31
Views: 4073

Re: Which components of a Pi have unique serial numbers..?

Which components of a Raspberry Pi have unique serial numbers..? I know there is a unique serial number written into the OTP registers when the Pi is manufactured. But what about other components..? I want to know which components have a unique serial number. Key word: UNIQUE. Then the answer is no...
by mutley
Thu Oct 20, 2016 9:23 pm
Forum: General discussion
Topic: Is there such a thing as an Pi iPod emulator?
Replies: 48
Views: 18995

Re: Is there such a thing as an Pi iPod emulator?

Thanks! But I'm not able to figure out much, I only know what I would like as the end result. Which is why I aske the question here in the forum. I'm no programmer (except for a bit of LUA and Python for home automation through Girder and EventGhost, with a lot of help) and I'm not hardware hacker ...
by mutley
Thu Oct 20, 2016 8:20 pm
Forum: C/C++
Topic: question about printf() in a pthread thread
Replies: 2
Views: 1756

Re: question about ptintf() i a pthread thread

The stdout stream is buffered, so will only display what's in the buffer after it reaches a newline (or when it's told to). So you can :- 1) Flush stdout after each print. 2) Print to stderr that's not buffered. 3) Turn off stdout buffering. 1) fflush(stdout); 2) fprintf(stderr, "."); 3) setbuf(stdo...
by mutley
Tue Oct 18, 2016 10:48 pm
Forum: General discussion
Topic: Raspbian with Read-only Root
Replies: 191
Views: 87594

Re: Raspbian with Read-only Root

The technique that I have described is similar to what is done by the live-boot package for booting PCs from DVDs. These methods all rely on getting Linux to load an initramfs upon boot which wasn't so easy to do on the Pi in the past. Running with a read-only root file system is very useful for re...
by mutley
Tue Oct 18, 2016 6:32 pm
Forum: General discussion
Topic: SOLVED - Starting java in rc.local consuming high cpu
Replies: 3
Views: 1418

Re: Starting java in rc.local consuming high cpu

Since it looks like your java program is a daemon, you should really write a sysvinit or systemd script to start it, and not run it in the background from rc.local. rc.local is really for running something 1 time on startup that terminates, not for a process that runs in the background. But in sayin...
by mutley
Mon Oct 17, 2016 1:36 pm
Forum: C/C++
Topic: C++ program executed from PHP not exporting GPIO properly
Replies: 4
Views: 1149

Re: C++ program executed from PHP not exporting GPIO properl

Check the permissions. Add apache user to /etc/sudoers with your executable and nopassword option, then execute it with "sudo executable" within PHP. DO NOT DO THAT. It opens a massive security hole. Use wiringPi in non-privileged mode. Use pigpio / pigpiod which allows a non-privileged client to d...
by mutley
Fri Oct 14, 2016 4:20 pm
Forum: Networking and servers
Topic: Five second lag from samba to Windows 7
Replies: 2
Views: 627

Re: Five second lag from samba to Windows 7

Sounds like something is being cached in the directory access. Probably on the windows side, so it may be worth reading about shared folders and local caching on windows. Quick google turned up this. http://stackoverflow.com/questions/5159220/windows-file-share-why-sometimes-newly-created-files-aren...
by mutley
Thu Oct 13, 2016 6:56 pm
Forum: C/C++
Topic: C++ program executed from PHP not exporting GPIO properly
Replies: 4
Views: 1149

Re: C++ program executed from PHP not exporting GPIO properl

Check the permissions. Add apache user to /etc/sudoers with your executable and nopassword option, then execute it with "sudo executable" within PHP. Something like www-data 192.168.1.0/255.255.255.0=(root) NOPASSWD: /usr/local/bin/mycommand (Obviously change the IP and mycommand to your system) I'v...
by mutley
Thu Oct 13, 2016 6:17 pm
Forum: General discussion
Topic: wifi on the zero without using the USB?
Replies: 20
Views: 3457

Re: wifi on the zero without using the USB?

Hi, I would like to know if I can add a wifi module to the pi without sacrificing my OTG port, because I want to use that to ssh to my pi from my mac. Once your PI is on the network (I assume that's why you want WiFi), you can ssh to it from your mac over the network connection, so there is no need...
by mutley
Thu Oct 06, 2016 2:50 pm
Forum: General discussion
Topic: Which components of the Pi have writable firmware..?
Replies: 113
Views: 11974

Re: Which components of the Pi have writable firmware..?

Just out of interest, what security issue/hole are you trying to fix? Serial numbers on any device have never been regarded as a security risk as far as I know. There is no security issue/hole, but there is an anonymity issue. From the questions it seems the OP is either confusing security with ano...
by mutley
Wed Oct 05, 2016 10:58 pm
Forum: Automation, sensing and robotics
Topic: Developing Linux SW for relay cards
Replies: 49
Views: 8367

Re: Developing Linux SW for relay cards

Vox45 wrote:Hello

I've been looking for a solution to manage my GPIO relay card with a RPI3.
I don't think it will, I took a very quick look at the source code and it looks like it will only work with USB relay boards, not GPIO.
by mutley
Wed Oct 05, 2016 2:03 pm
Forum: General discussion
Topic: How to do serial communication on Raspberry pi 3 using putty
Replies: 5
Views: 5766

Re: How to do serial communication on Raspberry pi 3 using p

I don't think you even need putty for what you are trying to do on a linux box. Simply look at the output of /dev/ttyUSB0 (or 1) to read what's being sent. sudo tail -f /dev/ttyUSB0 That will print the output directly to the terminal, you can write in exactly the same way with echo "bla bla bla" > /...
by mutley
Thu Sep 29, 2016 5:12 pm
Forum: General discussion
Topic: Running Raspberry Pis Cold Redundant
Replies: 15
Views: 2472

Re: Running Raspberry Pis Cold Redundant

- Is there anyway to improve my SD card reliability? The only thing I can think of is that I'm using a pair of DS18B20 Temperature sensors which are continuously writing to a file, other than that there's very little activity. My personal preference with fighting numerous SD card corruptions is to ...
by mutley
Thu Sep 29, 2016 4:55 pm
Forum: General discussion
Topic: I think other stuff is stealing USB serial data
Replies: 6
Views: 1063

Re: I think other stuff is stealing USB serial data

I've tinkered around with varying delays between opening the USB port and writing, and between writing and trying to read. I can run the exact same program over and over and sometimes I get my bytes back and sometimes nothing at all. The read loop was really just a troubleshooting thing to help me ...
by mutley
Thu Sep 22, 2016 9:55 pm
Forum: General discussion
Topic: Failure Switching RPi3B -> RPI2B
Replies: 10
Views: 1440

Re: Failure Switching RPi3B -> RPI2B

A clean install should work on either PI, but once you've done the raspberry update that updates the firmware, the SD card seems to be locked to that particular model. I've had similar experience between Zero, B and 2+, it seems to be something to do with the files in the overlays directory under bo...
by mutley
Thu Sep 22, 2016 9:42 pm
Forum: General discussion
Topic: 5GHz Radio support for raspberrry Pi 3
Replies: 4
Views: 6391

Re: 5GHz Radio support for raspberrry Pi 3

This one works on the Pi in 5GHz mode (and 2.4) https://www.amazon.com/gp/product/B00LGN8I40/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1 But supported is probably not the best term to use as without any additional drivers it will only work in 2.4Ghz. There are plenty of pre-compiled drivers out ther...
by mutley
Tue Aug 02, 2016 2:26 pm
Forum: General discussion
Topic: Problem With Forum Search
Replies: 4
Views: 1049

Re: Problem With Forum Search

Use google, type this into the search box

Code: Select all

site:www.raspberrypi.org/forums PI
That will search this forum (and only this forum) for the word PI.
by mutley
Thu Jul 28, 2016 6:56 pm
Forum: General discussion
Topic: Unique Serial Number
Replies: 21
Views: 14093

Re: Unique Serial Number

The serial number forms part of the MAC address, so I hope they are unique. A manufacturer can't (well they shouldn't) just arbitrarily make up MAC address. MAC Address are assigned in blocks to manufactures by IEEE. It's very common for manufactures to use the same MAC on multiple devices/machines...
by mutley
Thu Jul 28, 2016 6:47 pm
Forum: General discussion
Topic: Unique Serial Number
Replies: 21
Views: 14093

Re: Unique Serial Number

The serial number forms part of the MAC address, so I hope they are unique. That's only going to be a problem if you have 16 million on the same /8 subnet (and you'll run out of NAT port numbers with less than 64K stations). With NAT'd networks your only need to worry about your NAT router having a...

Go to advanced search