Raspberry Pi red light - usb

I have a Raspberry Pi B+ connected to an external USB disk, a Seagate Portable 1 Tb (no external power source).
Everything is working fine, but when the disk is writing/reading data, the red light (power) blinks, sometimes. But I don't have any power loss, or corrupted data.
I've tested with 3 different power sources:
1) a generic one, that blinks (5V 3A)
2) my original charger from Galaxy S4 (5V 2A) does the same
3) a Galaxy Tab 3 charger (5V 2A) the red light keeps always off
Since the original Samsung chargers are trustable, I believe that my external HD is using too much power? But if this is true, why Raspberry keeps on and I got no corrupted data?
The red light blinking but everything working fine is a real problem? Or can damage it in some weeks or months? Maybe I need consider stop using an external disk?
Thank you.

According to the wiki:
Red power LED is blinking
A blinking red power LED indicates problems
with the power supply. On model A and B, it is hard-wired to the 3.3V
power supply rail. If it is blinking, as one user has reported1 it
means the 5V power supply is dropping out. Use a different power
supply.
On model B+ (and presumably also the A+), the circuit has been
improved to give a much more reliable warning of poor power quality.
The red power LED is wired to an APX803 supervisor[2] which kicks in
when the 5V power supply drops below 4.63V[3]. If it does, the LED
will blink. Check your connections, cable, and power supply.

The raspberry pi 3B+ also seems to use the red pwr led as a error indicator !
I have a SD card (Apacer 16GB) that came with the pi, preloaded with noobs 245.
This card however does NOT work with the pi. When using this card: red pwr led on, NO green light, but after a few secs the RED led starts flashing a code every few seconds: 4x long, 3x short than on again.
So NO Power problem (5A supply, steady at 4.97v) !
This flashing red led only happens with this SD card, other SD cards boots OK....

Related

USB 2.0 "This device cannot start. (Code 10)"

This is probably a long shot question, but I try it anyway.
I'm developing hardware using PIC Microcontrollers (MicroChip). Communication is done through a FS USB 2.0 link.
I connect the microcontrollers to a Windows 10 Home edition, version 21H1, build 19043.1826. The processor is an AMD Ryzen 5 3600 6-Core Processor.
First I used the PIC18F45K50, for which everything worked fine from day one. But due to the shortages on the market, I now am experimenting with PIC18F47J53. Both microcontrollers are working fine, as I can (for example) control a MAX7219 controlled display (3 x 7-segment) and also control a bunch of LED's using an STP08CP05TTR. Clock timings seem also ok - I measured it with an oscilloscope.
These 2 microcontrollers are pretty much the same, at least for the core functionality such as USB. The differences that are relevant for the issue I'm reporting here are:
PIC18F45K50 uses internal clock of 8MHz, and has on board correction logic to keep clock synced for HS USB - this is a 5V processor
PIC18F47J53 uses a XTAL of 16MHz, all should be within the USB 2.0 specs - this is a 3.3V processor
I'm using the MPLab X IDE v5.45 with the MCC (MPLab Code Configurator) in which I setup the System Module (to set the correct clock frequencies including the 48MHz for USB) and where I configure the USB.
In both microcontrollers, the setup of the USB is exactly the same. I even checked the 4 files that are automatically generated by MCC, and except for the descriptors (I used different names), all is exactly the same.
When I connect the USB to my PC (same port), then the PIC18F45K50 works perfect. But the PIC18F47J53 gives error code 10.
This does not happen every time. For example, if I try 10 times (connect/disconnect the cable), then I had it 7 times. 1 time the device even didn't appear, and 2 other times I read "The device is working properly.". Although, in the latter case, my software that communicates with my controller isn't working, so there is still something wrong.
Based on the above, the first I would think of is some hardware issue. Although, the strange thing is that things like vendor ID (0x4D8), Product ID (0xA), BCD Device Release (0x100), Serial Number (12345678), etc... seem always to be read out correctly. If there would be a hardware problem, shouldn't I have more random issues with this as well? Or is this data read out in a slower mode than Full Speed (because that could of course explain this)?
Below are screenshots via "Device Manager / Ports (COM & LPT) / my serial device", then selecting the property in the Details.
If I compare the properties from the working microcontroller (PIC18F45K50) with the not working one (PIC18F47J53), it looks like all are exactly the same.
I also tried to compare the D- (CH1) and D+ (CH2) signals between the 2 microcontrollers with my oscilloscope. My USB knowledge is not detailed enough to interpret the signals, but what I can tell is that both look exactly the same to me, both timing wise and voltage level wise. Be aware that the CH2 signal on the PIC18F47J53 (D+), the second screenshot, is clipping in the picture below, but I measured it later and it shows the same voltage level as for the PIC18F45K50.
Does anybody here a single clue where I should look at in the first place? The good news is that I have a working and not working version, so I can start debugging step by step and compare. But some hints as where to start would be appreciated.
EDIT 24JUL2022
I did the measurement with my oscilloscope again. Now I soldered 2 wires to the USB port to be able to easily attach my probes. This time, both D- and D+ signals have a Vpp of about 3.3V. I put some cursors which also shows a pulse-width of about 84ns, which correlates with the USB HS frequency of 12MHz (should be 83.33ns).
I found the issue. The Vusb on my PIC18F47J53 had a bad (or was even not) connected. I gave it another touch of my soldering iron, and bingo! Now the "error 10" has disappeared completely, and each time I connect/disconnect it gives "This device is working properly.", and error 10 never appears. I now also see a continues signal on my oscilloscope - not one that is disappearing after a while. And I could send/receive already some commands.

GNU Radio and bladeRF on Raspberry Pi (simple FSK system)

I am having a problem porting a GNU Radio setup from PC (windows 10, USB3) to Raspberry Pi 2 (USB2). USB bandwidth and CPU should not be a problem I think (only around 30% utilization while running). Essentially it looks like the RPi is 'pausing' during transmission, while the PC is not. The receiver is running on PC in both cases. I am including a pic of what I see after the FSK demod when running transmitter on PC vs Pi (circled 'pause' area), as well as a picture of my (admittedly sloppy) schematic. Any help/tips is greatly appreciated.gnuradio schemreceived signals
Edit: It appears it may actually be processing limitations. Switching from 9400 baud to 2400 baud makes the issue go away. If anyone has experience with GNURadio...am I doing anything overly inefficient or should I just drop comm rate?
The first thing I would do would be to lower your sample rates.
You don't need 1.5Ms/s if you are going to keep only the lowest 32k in your low pass filter.
Then you could do the same for your second stage after the quadrature demod if it's not enough (by the way, the sample rate of your second low pass filter does not seem to match the actual sample rate of the stage which is still 1.5Ms/s if I'm not mistaken).
Anyway, Gnuradio uses a lot of processing power so try not to use a sampling rate way above what you actually need ;)
In your case, you could cut the incoming sample rate down to 64k (say 80 for safety). 18 times less samples to process might do the trick :)

Surface pro 3 in kiosk mode, how to automatically power on when the power is connected?

Most pc's had the nice option to power on a computer automatically when the power is applied (via the bios). With the surface pro 3 this is not an option (absent in the uefi boot menu).
If you are (planning on) using the Surface pro 3 tablet (or any uefi windows tablet?) you will run into this problem if you want to hide the power button of the tablet.
The surface pro 3 does activate when the power is connected when its sleeping. But for us the power could be disconnected for longer periods. The surface pro would go into hibernate mode or the battery would die, and in both of those cases you seem to need the power button to get it back to work.
There are 2 ways of going about this: changing the software, or changing the hardware. Personally (and as a software enthusiast) I wouldn't waste the time of rebuilding an entire kernel. I would actually go the hardware-modification route, even with limited experience (about 1 year).
But I'm going to make this sound easy. What you do, is, prop open the casing of the tablet so you can expose the motherboard and the power button.
Here are the materials you will need:
a needle-tip soldering iron, one of the smallest ones available.
good solder, ordered from online (Amazon) and not RadioShack brand (their solder beads up all the time and doesn't stick)
A >5v rated very very large capacitor (at least 3000uf to simulate holding the power button down for at least 3-5 seconds, get multiple/larger capacities just in case! 5500uf should be safe)
A 5v relay, to electronically toggle the power button (get some tiny solid-state ones on ebay)
Some patience
You will have to disassemble the power button and use your needle-tip to solder on manual leads (touching these leads should trigger the button)
Then, you will split a power V++ wire off the USB cable and attach the capacitor to it (the capacitor will send a 3-5 second pulse to the power button under DC power)
The negative side of the capacitor will connect to the coils on the relay (relay is a mechanical switch, to trip the power button in this case).
The NC (normally closed) switch side of the relay will connect the two leads of the power button.
I hope this helps you. The hardest part is soldering in the power button leads. Hopefully the button can be removed and soldered easily, without touching the ribbon cables. If you can't do the job, then use a DC motor to physically click the button. :) Good luck

Laptop USB port makes 2V 60Hz sine wave on pwm ports?

When I connect my Arduino Mega or Uno to my laptop (HP Pavilion dv6 Windows 7 64 bit) via usb it creates a 2V 60Hz sine wave in the pwm digital pins I am using (2V sine wave when digitalWrite to Low and 5V very noisy pwm when analogWrite is used), and smaller amp sine waves in all the other pins. If I plug either of the boards into a different computer, its totally fine and all the arduino pins give proper 0V or pwm signals. I did not have this problem 2 weeks ago when I ran it, but ran it again today and discovered this problem. The arduino does not appear to have suffered any permanent damage, as it still runs fine on other computers.
The only potentially notable thing I've done in between those two runs was accidentally try to run a motor off an arduino plugged into the laptop that needed more current than the arduino could source ( :$ ). The motor whined but nothing else happened in the second before I unplugged it. Should that be of interest, I only did it on one usb port, and both usb ports are showing this strange sine wave behavior.
Thoughts on what is going on? Is this something I can fix? Is it still safe to program the arduino with my laptop? (Which I can still do, the pins just behave funny until I move it to another computer). I am not able to install software on the other computer (not mine) so cannot do my arduino programming from there.
Thanks!
I had a similar problem between computers and laptops...
My problem was I was running USB power from my computer and a benchtop power supply to some of the digital inputs.
The solution was to cut the trace to isolate USB power from V-in.
This is explained here for Arduino and here for teensy3.1.
....although I didn't measure the signal, there was an overriding noise that limited the PWM output I could achieve...

Lighting Control with the Arduino

I'd like to start out with the Arduino to make something that will (preferably) dim my room lights and turn on some recessed lighting for my computer when a button or switch is activated.
First of all, is this even possible with the Arduino?
Secondly, how would I switch on and off real lights with it? Some sort of relay, maybe?
Does anyone know of a good tutorial or something where at least parts of this are covered? I'll have no problems with the programming, just don't know where to start with hardware.
An alternative (and safer than playing with triacs – trust me I've been shocked by one once and that's enough!) is to use X-10 home automation devices.
There is a PC (RS232) device (CM12U UK or CM11 US) you can get to control the others. You can also get lamp modules that fit between your lamp and the wall outlet which allows you to dim the lamp by sending signals over the mains and switch modules which switch loads on and off.
The Arduino has a TTL level RS232 connector (it's basically what the USB connection uses) – Pins 0 and 1 on the Diecimila so you could use that, connect it via a level converter which you can buy or make and connect to the X-10 controller, theirs instructions on the on the Arduino website for making a RS232 port.
Alternatively you could use something like the FireCracker for X-10 which uses 310MHz (US) or 433MHz (UK) and have your Arduino send out RF signals which the TM12U converts into proper X-10 mains signals for the dimmers etc.
In the US the X-10 modules are really cheep as well (sadly not the case in the UK).
Most people do it using triacs. A triac is like two diodes in anti-parallel (in parallel, but with their polarity reversed) with a trigger pin. A triac conducts current in either direction only when it's triggered. Once triggered, it acts as a regular diode, it continues to conduct until the current drops bellow its threshold.
You can see it as a bi-directional switch on a AC line and can vary the mean current by triggering it in different moments relative to the moment the AC sine-wave crosses zero.
Roughly, it works like this: At the AC sine-wave zero, your diodes turn off and your lamp doesn't get any power. If you trigger the diodes, say, halfway through the sine's swing, you lamp will get half the normal current it would get, so it lights with half of it's power, until the sine-wave crosses zero again. At this point you start over.
If you trigger the triac sooner, your lamp will get current for a longer time interval, glowing brighter. If you trigger your triac latter, your lamp glows fainter.
The same applies to any AC load.
It is almost the same principle of PWM for DC. You turn your current source on and off quicker than your load can react, The amount of time it is turned on is proportional to the current your load will receive.
How do you do that with your arduino?
In simple terms you must first find the zero-crossing of the mains, then you set up a timer/delay and at its end you trigger the triac.
To detect the zero-crossing one normally uses an optocoupler. You connect the led side of the coupler with the mains and the transistor side with the interrupt pin of your arduino.
You can connect your arduino IO pins directly to the triacs' triggers, bu I would use another optocoupler just to be on the safe side.
When the sine-wave approaches zero, you get a pulse on your interrupt pin.
At this interrupt you set up a timer. the longer the timer, the less power your load will get. You also reset your triacs' pins state.
At this timers' interrupt you set your IO pins to trigger the triacs.
Of course you must understand a little about the hardware side so you don't fry your board, and burn your house,
And it goes without saying you must be careful not to kill yourself when dealing with mains AC =).
HERE is the project that got me started some time ago.
It uses AVRs so it should be easy to adapt to an arduino.
It is also quite complete, with schematics.
Their software is a bit on the complex side, so you should start with something simpler.
There is just a ton of this kind of stuff at the Make magazine site. I think you can even find some examples of similar hacks.
I use MOSFET for dimming 12V LED strips using Arduino. I chose IRF3710 for my project with a heat sink to be sure, and it works fine. I tested with 12V halogen lamp, it worked too.
I connect PWM output pin from Arduino directly to mosfet's gate pin, and use analogWrite in code to control brightness.
Regarding 2nd question about controlling lights, you can switch on/off 220V using relays, as partially seen on my photo, there are many boards for this, I chose this:
As a quick-start, you can get yourself one of those dimmerpacks (50-80€ for four lamps).
then build the electronics for the arduino to send DMX controls:
Arduino DMX shield
You'll get yourself both the arduino-expirience + a good chance of not frying your surrounding with higher voltage..