gorgi.rankovski
Posts: 3
Joined: Thu Feb 02, 2017 2:05 pm

Weird effects on images from camera on Raspberry Pi 3B+ with a D-Link 4G USB dongle attached to it

Thu Dec 06, 2018 2:55 pm

Hello! We have been struggling with this issue for a while now and have isolated what might be causing the issues. Our suspicion is the combination of Raspberry Pi 3B+ and 4G dongle. We couldn't reproduce the problem with 3B model, using same SD card, same camera and same 4G dongle. It seems like the issue is with the 3B+. Take a look at these images:


With Raspberry Pi 3B:
RPI3.jpg
RPI3.jpg (61.84 KiB) Viewed 602 times
With Raspberry Pi 3B+
RPI3+_1.jpg
RPI3+_1.jpg (86.58 KiB) Viewed 602 times
One more example with Raspberry Pi 3B+
RPI3+_2.jpg
RPI3+_2.jpg (83.68 KiB) Viewed 602 times
On the 3B+ model there are thick lines with color. And these lines do not appear after every boot. Sometimes in can take 5 hours for them to start appearing, but usually they appear soon after the boot (~5 minutes). Once they start appearing, they never go away, until the reboot.

We haven't tested with other model of 4G dongles, as we've been using the D-Link ones for a long time with the 3B model.

Has anyone experienced something similar with the camera? Any type of advice would be helpful.

Thanks!

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6864
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Weird effects on images from camera on Raspberry Pi 3B+ with a D-Link 4G USB dongle attached to it

Thu Dec 06, 2018 4:05 pm

That looks like you've got an issue with unreliability or interference in the comms between the camera and Pi, one would guess due to the 4G dongle.

The flexi cable between Pi and camera has:
- 3V3 power.
- a couple of GPIOs to control the regulators to the sensor (the sensor itself needs 1V8, 2V8, and 1V2 rails)
- I2C to configure the sensor - 100kHz.
- 1 CSI2 clock lane (differential pair), and 2 CSI2 data lanes (again differential pairs). Somewhere around 330MHz, and LVDS.

What I suspect is happening is that you are getting corruption on the CSI2 data pairs. Each line of the image has error checking, and correction for 1-bit errors. More bit errors than that result in the line being dropped.
The problem with that becomes that the sensor has a Bayer colour filter over it, so you get alternating lines of

Code: Select all

RGRGRGRGRGRGRG
GBGBGBGBGBGBGB
Drop a line and you're interpreting an RG line as GB, and GB lines as RG, which generally gives these purple hues. Corrupt a second line and you go back to correct colours.

CSI2 has generally proved to be fairly robust. It was designed for short interconnects within a phone/tablet, but people have managed to run it at up to a metre (one doesn't want to think about the EMC profile at that point). The longer you make that cable the greater the chance of issues.
The Pi + Pi camera combination has been EMC tested for both emissions and rejection with the length of cable supplied. Change the cable, or use a third party V1 compatible camera, and you may well get problems. There may be variations between individual boards, but they should be small.

Suggestions :
- shorten the camera cable.
- add a screen around the camera cable.
- separate the Pi (or more the camera & flex) and 4G dongle.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
mooblie
Posts: 122
Joined: Fri Oct 14, 2016 2:07 pm
Location: The Scottish Highlands

Re: Weird effects on images from camera on Raspberry Pi 3B+ with a D-Link 4G USB dongle attached to it

Thu Dec 06, 2018 4:15 pm

6by9 wrote:
Thu Dec 06, 2018 4:05 pm
......
- shorten the camera cable.
.......
May I ask: I bought a Pi camera recently that had two cables - a short one and another one metre long!! :o Is there a limit to this cable length (maybe because of such interference/pickup)?
-----
Edit: Sorry 6by9 - just seen you did mention a one metre cable above. Sounds like it's not recommended, but might work if used in an otherwise quiet environment?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6864
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Weird effects on images from camera on Raspberry Pi 3B+ with a D-Link 4G USB dongle attached to it

Fri Dec 07, 2018 8:09 am

mooblie wrote:
Thu Dec 06, 2018 4:15 pm
6by9 wrote:
Thu Dec 06, 2018 4:05 pm
......
- shorten the camera cable.
.......
May I ask: I bought a Pi camera recently that had two cables - a short one and another one metre long!! :o Is there a limit to this cable length (maybe because of such interference/pickup)?
-----
Edit: Sorry 6by9 - just seen you did mention a one metre cable above. Sounds like it's not recommended, but might work if used in an otherwise quiet environment?
You won't have bought a camera cable designed/sold by Raspberry Pi Trading that is that long, as the system would then fail EMC. What third parties sell is up to them, but performance can't be guaranteed.
I've seen some 2m flexi cables, and others have used the adapters to use HDMI cables and achieved 5m, but it'll be partly luck as to whether they work. IIRC the CSI clock and data pairs are using <100mV of swing in high speed mode, so you need to protect thoses. You'll be getting voltage losses in the power rails too, so the size of those conductors is going to make a difference.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
HermannSW
Posts: 1234
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Weird effects on images from camera on Raspberry Pi 3B+ with a D-Link 4G USB dongle attached to it

Fri Dec 07, 2018 10:51 am

I agree on the official standpoint wrt short cables, especially EMC.
But I have to say that I use a 2m cable and normal cable routinely and have never seen differences.
Just now I took a 200fps raspivid recording over 2m cable without issues:

Code: Select all

$ raspivid -md 7 -w 640 -h 480 -fps 200 -p 100,100,640,480 -o 12.h264
https://www.youtube.com/watch?v=1P5mMTY ... e=youtu.be
Image
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/fork-raspiraw
https://github.com/Hermann-SW/userland
https://twitter.com/HermannSW

Return to “Camera board”