Go to advanced search

by DarkElvenAngel
Tue Jun 25, 2019 3:08 am
Forum: Advanced users
Topic: Need a script to detect available displays.
Replies: 5
Views: 483

Re: Need a script to detect available displays.

Hello, I have a software framework I wrote for a kiosk display this works very well at detecting during boot if an HDMI display is connected or not. Giving the framework the ability to run in different modes. Ie kiosk or headless. My problem is I don't know how to detect other types of displays ie ...
by DarkElvenAngel
Tue Jun 25, 2019 2:46 am
Forum: C/C++
Topic: What is the correct way to use /dev/gpiomem with mmap to get access to Raspberry PI3 peripherals
Replies: 11
Views: 512

Re: What is the correct way to use /dev/gpiomem with mmap to get access to Raspberry PI3 peripherals

My apologies, As the code excerpt shows I thought that this was the default behavior. And there is also code for handling gpio in that manner. It is a case of looking at parts of something and not it's whole. In that light as you are saying it uses the /dev/mem and /dev/gpiomem then what is this co...
by DarkElvenAngel
Mon Jun 24, 2019 10:36 pm
Forum: C/C++
Topic: What is the correct way to use /dev/gpiomem with mmap to get access to Raspberry PI3 peripherals
Replies: 11
Views: 512

Re: What is the correct way to use /dev/gpiomem with mmap to get access to Raspberry PI3 peripherals

My apologies, As the code excerpt shows I thought that this was the default behavior. And there is also code for handling gpio in that manner. It is a case of looking at parts of something and not it's whole. In that light as you are saying it uses the /dev/mem and /dev/gpiomem then what is this cod...
by DarkElvenAngel
Mon Jun 24, 2019 9:06 pm
Forum: C/C++
Topic: What is the correct way to use /dev/gpiomem with mmap to get access to Raspberry PI3 peripherals
Replies: 11
Views: 512

Re: What is the correct way to use /dev/gpiomem with mmap to get access to Raspberry PI3 peripherals

I believe also by default WiringPi doesn't use /dev/gpiomem it uses the Linux kernel interface and uses /sys/class/gpio/gpio## that might be why you don't see any conflicts. No! Take a look at WiringPi sources. It tries /dev/mem first and, if the user is not running as root, it uses /dev/gpiomem . ...
by DarkElvenAngel
Mon Jun 24, 2019 8:55 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: How soon are interfaces available
Replies: 0
Views: 68

How soon are interfaces available

Hello all, I'm working on a headless setup and I want to add a status OLED display that can show what's going on. I use an initramfs and was just wondering if SPI and/or i2c are loaded this early in the boot process or how can I discover when they are available for uses. Thanks. My OS of choice is R...
by DarkElvenAngel
Sat Jun 22, 2019 5:38 pm
Forum: C/C++
Topic: What is the correct way to use /dev/gpiomem with mmap to get access to Raspberry PI3 peripherals
Replies: 11
Views: 512

Re: What is the correct way to use /dev/gpiomem with mmap to get access to Raspberry PI3 peripherals

I believe also by default WiringPi doesn't use /dev/gpiomem it uses the Linux kernel interface and uses /sys/class/gpio/gpio## that might be why you don't see any conflicts.
by DarkElvenAngel
Fri Jun 21, 2019 4:53 pm
Forum: C/C++
Topic: What is the correct way to use /dev/gpiomem with mmap to get access to Raspberry PI3 peripherals
Replies: 11
Views: 512

Re: What is the correct way to use /dev/gpiomem with mmap to get access to Raspberry PI3 peripherals

Have a look at the BCM2835 library
https://www.airspayce.com/mikem/bcm2835/. That library uses /dev/gpiomem for gpio however you need to use /dev/mem for I2C unless you want to bitbang the protocol.
by DarkElvenAngel
Fri Jun 21, 2019 4:48 pm
Forum: C/C++
Topic: WiringPi / Raw SPI speed issue
Replies: 8
Views: 362

Re: WiringPi / Raw SPI speed issue

Hello I see to have found an issue with the SPI bus and how to get any kind of speed from it. I have tried three libraries BCM2835 no issues with speed WiringPi seems to max out at 500kHz Raw SPI seems to max out at 500kHz This all came about when trying to get my OLED to run faster I assumed the d...
by DarkElvenAngel
Sun Jun 16, 2019 10:35 pm
Forum: C/C++
Topic: WiringPi / Raw SPI speed issue
Replies: 8
Views: 362

Re: WiringPi / Raw SPI speed issue

I'll give that a try, the way things are written it only sends one byte at a time and I haven't tried this beyond the sample code.
by DarkElvenAngel
Sun Jun 16, 2019 9:09 pm
Forum: C/C++
Topic: WiringPi / Raw SPI speed issue
Replies: 8
Views: 362

Re: WiringPi / Raw SPI speed issue

Why not just use the bcm2853 library? The limit you are reaching is probably the number of SPI transfers per second you can do with the Linux SPI driver. I was hoping to avoid the root access required for bcm2853. I wasn't aware there was transfer limit I did see something about a buffer is there a...
by DarkElvenAngel
Sun Jun 16, 2019 8:16 pm
Forum: C/C++
Topic: WiringPi / Raw SPI speed issue
Replies: 8
Views: 362

WiringPi / Raw SPI speed issue

Hello I see to have found an issue with the SPI bus and how to get any kind of speed from it. I have tried three libraries BCM2835 no issues with speed WiringPi seems to max out at 500kHz Raw SPI seems to max out at 500kHz This all came about when trying to get my OLED to run faster I assumed the dr...
by DarkElvenAngel
Sun Jun 16, 2019 5:46 pm
Forum: C/C++
Topic: OLED interface problems
Replies: 12
Views: 2015

Re: OLED interface problems

So I gave WiringPi driver another shot since it works without root access however the speed is not there, the driver is coded to run at 9000000 or 9MHz however changes to that number have no effect on performance and the screen update is slow. I was going to use the standard SPI interface as Gordon ...
by DarkElvenAngel
Sun Jun 16, 2019 3:45 pm
Forum: C/C++
Topic: OLED interface problems
Replies: 12
Views: 2015

Re: OLED interface problems

What sample rate (time) did you set piscope to use? Remember you need to be sampling at least twice as fast as the bus clock (ie. > Nyquist limit) Trev. Yeah I was running the daemon on the default settings. Now using: sudo pigpiod -s 1 -b 200 -f Okay I did a combination of using a slow SPI clock a...
by DarkElvenAngel
Sun Jun 16, 2019 5:48 am
Forum: C/C++
Topic: OLED interface problems
Replies: 12
Views: 2015

Re: OLED interface problems

... Is there a way to spy on the bus and log what is sent including two gpio pins? I don't have fancy test equipment like a logic analyzer. I thought I saw a program for the RPI that could do this. Were you thinking of piscope ** perhaps? (I no longer have access to oscilloscopes etc. and have foun...
by DarkElvenAngel
Fri Jun 14, 2019 2:55 pm
Forum: C/C++
Topic: Setup Cross-Compile chain for RPi3
Replies: 7
Views: 1173

Re: Setup Cross-Compile chain for RPi3

You are right jahboater the pi zero is slow I mostly use it over ssh from my pi 3B+ and use Genie to edit and write the bulk of my code, I also use nano directly on the zero. It might seem strange not to just use the more powerful pi to do the compile however I'm not ever compiling anything that tak...
by DarkElvenAngel
Fri Jun 14, 2019 5:26 am
Forum: C/C++
Topic: OLED interface problems
Replies: 12
Views: 2015

OLED interface problems

@[email protected].net The SPI code you use, does it require root access to work? My driver works and writes to the OLED as intended with one issue it will only work if I run the demo program first, this problem popped up after reboot. Is there a way to spy on the bus and log what is sent including two ...
by DarkElvenAngel
Fri Jun 14, 2019 4:09 am
Forum: C/C++
Topic: Setup Cross-Compile chain for RPi3
Replies: 7
Views: 1173

Re: Setup Cross-Compile chain for RPi3

I'm speaking in general, I write code on my pi0w and compile it there. From that build I can deploy and run that code on any pi including a pi3 b+. As long as you have the correct libraries installed you shouldn't have problems. When cross compiling you need to be sure that the library versions in y...
by DarkElvenAngel
Tue Jun 11, 2019 12:27 am
Forum: C/C++
Topic: OLED interface problems
Replies: 12
Views: 2015

Re: OLED is slow and CPU intensive

I'm looking to change when the BCM2835 Library accesses the /dev/mem or /dev/gpiomem. I don't want my program running as root The question is this currently /dev/mem has read only permission by group kmem is there harm in changing this the read write? Further what is the best way to force the librar...
by DarkElvenAngel
Thu May 30, 2019 3:38 am
Forum: C/C++
Topic: Setup Cross-Compile chain for RPi3
Replies: 7
Views: 1173

Re: Setup Cross-Compile chain for RPi3

A Raspberry Pi 2 Binary should be compatible with a pi 3 are you able to build one of them? I build binaries on a pi zero and they will run on any raspberry Pi.
Give that a try.
by DarkElvenAngel
Mon May 27, 2019 2:49 pm
Forum: C/C++
Topic: OLED interface problems
Replies: 12
Views: 2015

Re: OLED is slow and CPU intensive

If you read the wiringPi sources, you'll find that the wiringPiSPI code is just some dumbed-down 2 or 3-line wrappers round the bog-standard Linux kernel SPI driver, so actually using wiringPi as a template to write your own 2 or 3-line function to do what you need to do ought to be a 5-minute task...
by DarkElvenAngel
Thu May 23, 2019 8:25 pm
Forum: C/C++
Topic: OLED interface problems
Replies: 12
Views: 2015

Re: OLED is slow and CPU intensive

Well, 128x128is only 16k at 8bpp, and the SPI can run up to 125MHz, but I'm not that familiar with SPI so not sure of the CPU overheads at those speed. It does sound odd, so I'd suspect bad software somewhere. https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/README.md That was som...
by DarkElvenAngel
Wed May 22, 2019 5:46 pm
Forum: C/C++
Topic: OLED interface problems
Replies: 12
Views: 2015

Re: OLED is slow and CPU intensive

After some searching online I can see that a full screen redraw isn't fast as each pixel requires 4 bits each. My current thinking is the library supplied to use the display is not well written and is causing the CPU load to be much higher than it needs to be. I'm attempting to write a new C library...
by DarkElvenAngel
Sun May 19, 2019 3:06 am
Forum: C/C++
Topic: OLED interface problems
Replies: 12
Views: 2015

OLED interface problems

I'm having a problem with my oled display code. Hardware: RPI B+ / RPI 0W OLED: Waveshare SSD1327 128x128 SPI mode My goal is to make a nice system monitor display for a headless server. However the included software I got working is slow to draw a screen and CPU load well 74% to update a clock... S...
by DarkElvenAngel
Wed May 15, 2019 5:23 pm
Forum: C/C++
Topic: I just 'open sourced' my SSD1306 I2C OLED code
Replies: 17
Views: 6013

Re: I just 'open sourced' my SSD1306 I2C OLED code

Fonts are a tricky topic and I just took the easiest route with this code. There are licensing issues and data format issues. I'm sorry, but I don't have a good answer for you. I've seen websites that can dynamically generate a font, but it will probably not come out in the right format to use my e...
by DarkElvenAngel
Wed May 15, 2019 12:24 am
Forum: C/C++
Topic: I just 'open sourced' my SSD1306 I2C OLED code
Replies: 17
Views: 6013

Re: I just 'open sourced' my SSD1306 I2C OLED code

I wanted to thank you for sharing your library! I have a few questions how do you customize the font? I would just want to add some custom symbols. Is it best to define a new font or extend one that exists? As I've never used an OLED until yesterday I was wondering how difficult is it to add support...

Go to advanced search