I have a two XBee-network. The first one is connected to a BeagleBone Black and the second one is connected to my PC.
The BeagleBone Black is sending sensor values to the PC regularly, 10 times a second, etc. But when I send a command to the BeagleBone Black from my PC, the BeagleBone Black stops sending messages.
The BeagleBone Black can send or receive successfully (separately). The error occurs only after receive. And even after error occurs, the BeagleBone Black can still receive. It just can't send.
After the error occurs, when I restart the BeagleBone Black program, the problem is solved. But if I restart the PC program, the problem continues. Therefore problem is on the BeagleBone Black.
I checked everything, but I couldn't find the problem.
Note: XBees work in API Mode.
Since you do not share your code, I'll share two solutions that come to mind:
1- The communication range of the XBee module is too much. Ten data may be a little low at the moment. Send more data.
2- You have incorrectly configured send and receive actions in your code. If you do not release the serial port after the data from the serial port is complete, you may have stuck in the read mode.
If you share your code, it will be incomplete or the problem will appear more easily.
Related
I have a gimbal device which takes MAVLink commands over a uart port. I need to connect it to a UAV through the telem port of a Pixhawk board.
When I use a serial to USB cable and connect the gimbal to my PC and send the appropriate serialized MAVLink commands through the connection I can get the gimbal to work as expected. When connect the telem output of the Pixhawk board to my PC, save a chunk of the data (byte string) going through, and send the same data to the gimbal through the same process as above, the gimbal works as expected. But connecting the gimbal to the Pixhawk board in the same way fails to make it work. The baud rates on both sides are the same.
Any idea what the issue might be?
I don't have a background in hardware and I'm not sure how data transfer over serial takes place but I think the issue might be on the "network layer" of the communication. I tried slowing down the rate of messages from the pixhawk side but it didn't help. To try and reproduce the issue, I tried to add randomized strings in between messages and adding delays in between parts of a message while sending messages from my PC to the gimbal but it still worked as expected, so I'm really at my wits end at identifying where the issue might be.
Another idea I had was saving the "stream" of data coming from the telem port and sending the same to the gimbal from my PC but I didn't find a way to do this. Is there an equivalent to pcap files for serial communication?
I was able to make a working HID USB stack on my "StartUSB for PIC" board for the 18F2550 microcontroller. I based it on one of the MLA libraries, which was made for the 18F45K50 (MLA 2018_11_26, hid_custom, picdem_fs_usb_k50.x), but I converted it to work with the 18F2550 (there might have been easier ways, but only learned to work with PIC about 1 month ago). On the host side, I'm using LibUsbDotNet (also here, there might be easier ways - the documentation on this library really sucks) on a Windows 10 machine.
I'm using the HID class, full speed, and all seems to work. Although, I get some random errors on the host PC (see below), but doing one close/re-open cycle on the host side when getting the error is kind of solving it. Dirty, but it works. So I kind of ignore this now.
Win32Error:Win32Error:GetOverlappedResult Ep 0x01
995:The I/O operation has been aborted because of either a thread exit or an application request.
I'm not an expert on USB (yet). But all examples I'm seeing are based on 1) you send first a command to the device and 2) then you retrieve the answer from the device. I did some performance tests, and see that this indeed shows that I can do about 500 cycles/second. I think that is correct, because each cycle, sending command and retrieving answer, each takes 1 msec.
But do I really need to send a command? Can't I just keep reading endlessly, and when the device has somthing to say, it does send the data in an IN transaction, and when not it ignores which creates a timeout on the host side. That would mean that I can poll at 1000 cycles/second? Unfortunately, I have tried it by changing my implementation on the PIC, but I get very weird results. I think I have issues with suspend mode. That brings me to another question - how can I make the device get out of suspend mode (means that not the host, but the device should be triggering this event). I have searched the MLA library for command such as "wakeup", "resume", ... but couldn't find anything.
So, to summarize, 2 questions:
Conceptual: Can I send data from device to host without being requested for it by a command from the host?
For PIC experts: How can I have a device trigger for a wakeup from suspend mode?
And indeed, the answer is Yes on the first question.
In the meantime, I found another link on the web that contains a Visual Studio C# implementation of a USB library including all the source files.
If you're interested, this is the link
This C# host implementation works as a charm. Without sending a command to the device, I get notified immediately if a button is pressed. Great!
It also proofs that my earlier device implementation based on the original MicroChip MLA, is 100% correct. I stress tested the implementation by sending a "toggle LED command" as fast as I could, and I reach 1000 commands/second. Again great!
I think that LibUsbDotNet isn't that perfect after all. As I wrote above, I get rather unstable communication (Win32Error). But with this implementation, I don't get a single error, even after running for half an hour # 1000 commands/second.
So for me, case closed.
Hey so what I'm trying to do is take HDMI input (from a computer) to a splitter from which one channel goes to some viewing device (projector or something) while the other channel goes through a capture card into another system for some processing that I'm doing. However, four seconds after I connect my capture card to one of the splitter's output channels the splitter just stops outputting on that channel and essentially shuts that channel off (as seen by the LED on it). However, if I connect a projector to the other output channel it stays working fine on that.
Keep in mind that the input I'm using is from a MacBook Pro. When I switch the input to an Xbox 360 everything works absolutely fine. Also, if I connect the input (MacBook) directly to the system bypassing the splitter it works absolutely fine. Can someone explain what might be going wrong here when I put the splitter in the mix?
Here is the equipment that I'm using:
Splitter: http://www.gofanco.com/2-port-hdmi-splitter-4k-black-splitter2p.html
Capture Card: https://www.amazon.com/Video-Capture-Device-1080P-Grabber/dp/B01N4SM7H6/ref=sr_1_7?ie=UTF8&qid=1522955789&sr=8-7&keywords=full+hd+video+capture
Any help would be greatly appreciated :)
I would guess this may be an EDID issue. A display or capture device negotiates the best resolution and frame rate via EDID with your graphics card.
Now if you put the splitter in between the EDID based communication can go sideways.
HDCP could be another reason. Your splitter may not correctly handle or advertise HDCP
I used successfully my raspberry camera times ago.
Now I tried again to acquire a image with the raspistill -o image.jpg command; the red led on the camera flashes, but I get this error:
mmal: No data received from sensor.
Check all connections, including the Sunny one on the camera board
Of course the camera connections are fine. Is there any other way to check if the camera is still working?
This error usually appears because of a faulty connection with the camera.
I had the exact same problem in different camera+Pi configurations. The following case is what I encountered:
The connector is not correctly inserted either in the camera or in the Pi.
The Sunny connector (the small yellow one on the camera) is not connected well.
(now it gets interesting)
If you often remove and reinsert the camera in the Pi please be sure to remove all power from the Pi. The sensor is very sensitive and a spark on the wrong pin could burn it. (I did this already unfortunately)
This could also trigger a problem with the Pi connector pins. It was somewhat confirmed that for Pi2 the connector may have some bad soldering which could lead to cold contact soldering. You can fix this by using some flux on the pins and then pass the soldering iron hot end over the pins to remake the connection.
I used a longer cable that had both connectors on the same side of the cable. If you connect it like it is you can burn your sensor and the Pi will not start because of the power surge (also the camera gets very hot in this case). DO NOT REMOVE IT from the Pi without removing power before. To a cable like this you have to remove the blue plastic from one end and bend the connector with the contacts on the other side. Insert this end in the camera since this will not be removed/inserted as often as the Pi end.
Make sure that the silver contacts are well inserted into the PCB connector.
(video here)
Also, make sure that the sunny connector is firmly attached.
This fixed it for me.
I was experiencing the same problem too, until I found a solution.
I removed the sunny connector(the yellow thingy below the camera in the board) and fixed it in the same place. The camera is working fine after trying this.
I have got the same issue. I have find out it was a power supply issue.
Try to change your cable and/or your raspberry power supply adaptor.
You check if this is your reason of your problem by typing:
$ dmesg
if you see something like this:
[ 44.152029] Under-voltage detected! (0x00050005)
-> Then replace your power supply! :D
The only fix for me was to purchase a new camera.
No real root causes identified.
My problem was I put the camera in, while the Pi was on. which might
have made the camera shot. i.e the camera module is static sensitive
and it's possible that it's been damaged
Unfortunately if this is the case there's nothing you can realistically do to fix it, just get a replacement.
This specific error shows when another application is using the camera. In my case, it was motion.
It might be possible that the cable is placed the wrong way. I had this problem and after multiple tries I realized that was the problem.
I'm writing a simple virtual serial port device to report an older serial port. By this point I'm able to enumerate the device and send/receive characters.
After a varying number of bulk-out transmissions from the host to the device the endpoint appears to give up and stop transferring data. On the PC side I receive a write error, and judging from a USBlyzer trace the music stops on a stall (USBD_STATUS_STALL_PID). However my code never intentionally issues a STALL condition on that endpoint and the status flag for having generated one never gets set though.
Given the short amount of time elapsed (<300 µs) between issuing the request and the STALL it would appear to be an invalid response of some sort, and not a time-out. On the device side the output endpoint is ready to go, with data in the buffer and proper DATA0/1 synchronization, but nothing further ever happens.
Note that the device appears to work fine even for long periods of time until I start sending "large" quantities of data. As near as I can tell the device enumeration/configuration also appears to complete successfully. Oh, and the bulk-in endpoint continues to work just fine after this.
For the record I'm using the standard Windows usbser.sys driver and an XMega128A4U µP. I'm also seeing the same behaviour across multiple Windows Vista and 7 machines.
Any ideas what I'm doing wrong or what further tests I might run to narrow things down?
USBlyzer log,
USB CDC stack,
test project
For the record this eventually turned out to be an oscillator problem. (Apparently the FLL's reference is always 1,024 Hz even when the 1,000 Hz USB frames are chosen. The slight clock error meant that a packet occasionally got rejected if it happened to contain one too many 1-bits in a row.)
I guess the moral of the story is to check the basics before assuming you've got a problem with the higher-level protocol. Also in retrospect a hardware USB analyzer would have been a worthwhile investment, the software alternatives mostly seems to spit out a generic error code or nothing at all when something goes awry.
Stalling the out-endpoint may happen on an overflow of the output buffer on the host side. Are you sure that the device does fetch the data it receives via out-endpoint - and if so does it fetch the data at least as fast as data is sent to the device?
Note that the device appears to work fine even for long periods of
time until I start sending "large" quantities of data.
This seems to be a hint for an overflow of the output-buffer.