Failed to open rtlsdr device #0 - java

We have the task to use some piece of hardware to analyse the signals send by a glider plane, like ADSB or ELT.
For this we decided to use the following hardwarestick:
link
We want to use the rtl_tcp tool to get the information to the program.
My problem is that I always get this message:
C:\MyProject\rtlsdr\x64>rtl_test
Found 1 device(s):
0: Generic RTL2832U (e.g. hama nano)
Using device 0: Generic RTL2832U (e.g. hama nano)
Failed to open rtlsdr device #0.
does anyone know what the problem could be? i tryed reinstalling the driver over zadig multiple times, without success.
the driver i choose was: WinUSB (v6.1.7600.16385)

Related

DJI mavic pro : Receiving corrupted video when using remote controller

I am currently developing an Android application using your SDK. This application is supposed to connect to a Mavic Pro drone in order to receive its video stream and other relevant data.
This application works well when the phone is connected to the drone via WiFi, however, the video stream is corrupted when the phone is connected via the remote controller.
To receive the video frames, I use the following code :
// Callback fired when receiving a new frame of 'size' bytes
VideoFeeder.getInstance().getPrimaryVideoFeed().setCallback((bytes, size) -> {
if (codecManager != null) {
// Shows the video in a "SurfaceTexture" on the phone
codecManager.sendDataToDecoder(bytes, size, UsbAccessoryService.VideoStreamSource.Camera.getIndex());
DroneVideoFrame videoFrame = new DroneVideoFrame(bytes, size, getVideoWidth(), getVideoHeight());
}
});
As mentioned above, this snippet works perfectly when connecting to the drone via WiFi. To be exact, each frame contains ~2000 bytes of data, the video is in 1280x720p in 24fps. The resulting video quality is perfect.
However, when using the remote controller, the data I get is completely different. While the "size" variable tells me that the received frame weighs ~2000 bytes, the frame itself (contained in the variable named "bytes") weighs more than 30 kilobytes. Moreover, this 30 Kb frame seems to be corrupted as it mostly contains what I recognize as buffer bytes (a long sequence of 0's).
Also, the functions "getVideoWidth" and "getVideoHeight" return respectively "9px" and "16px", which is obviously wrong. Moreover thoses function return correct values when using the drone WiFi.
What I have tried :
Update the firmware
Update DJI Go 4 application.
Truncate the buffer bytes (sequences of '0') seen in the frame. This results in a video full of artifacts as seen in the following image
System information :
Drone : DJI Mavic Pro, firmware up to date as of 09 July 2018
Phone : Panasonic FZ-N1 "Toughpad" - Android version : 6.0.1
Would you have any idea what causes that corruption ?
You have to rule out the problem one by one
(1) Can try downgrade one version? it would be a firmware issue. DJI is known to have this sort of problem. Latest doesn't mean safest. For consumer product review, you can refer to here https://forum.dji.com/thread-120739-1-1.html.
If you are a DJI partner, you can call them to confirm on firmware. Today we just had some firmware issue with M200 and PSDK. And we msgs them and they quickly replied. We have to change the firmware to enable gimbal power control for DJI PSDK.
(2) Change a RF spectrum, say from 15 to 18. To make sure it is not because of some frequency hopping or intentional jamming from other people
(3) If changing firmware version and RF doesn't help, try to borrow a 2nd set and run the same code to rule out the hardware issue e.g broken rf link.
(4) If you borrowed a drone and they all have the same problem, then it could be somewhere in your code, there is a bug.
Thats all i can think so far. Ill add if I remember something else

Braintree + Google Pay got DEVELOPER_ERROR (statusCode=10)

We developing app for food ordering. In this case we implemented Braintree payment. All is well. The next step is to implement Google Pay (I pay your attention, NOT Android Pay).
I used this documentation:
Braintree Docs:
https://developers.braintreepayments.com/guides/pay-with-google/configuration/android/v2
Google PwG Docs:
https://developers.google.com/payments/setup
This how do we implemented Google Pay:
private GooglePaymentRequest getGooglePaymentRequest(String total) {
return new GooglePaymentRequest()
.transactionInfo(TransactionInfo.newBuilder()
.setTotalPrice(total)
.setTotalPriceStatus(WalletConstants.TOTAL_PRICE_STATUS_FINAL)
.setCurrencyCode("AUD")
.build())
.emailRequired(false)
.shippingAddressRequired(false)
.phoneNumberRequired(false)
.allowPrepaidCards(true)
.billingAddressRequired(false);
}
And use:
String total = String.format(Locale.getDefault(), "%1$.2f", basket.total);
DropInRequest dropInRequest = new DropInRequest()
.clientToken(clientToken)
.amount(total)
.googlePaymentRequest(getGooglePaymentRequest(total))
.collectDeviceData(true);
getMvpView().showBraintreePaymentScreen(dropInRequest);
In this case we got two situations:
On my colleague's device all is working well (video: https://drive.google.com/open?id=1wEXbv8qzGXzuXWDUy7-bhIdud_4H_s2V)
On my side I got crash (video: https://drive.google.com/open?id=15gvtkNGZ9w6v1ym7cDkwWCnqHh5JUvL7)
After this I started debug and observed next situation:
As you see in Braintree's BaseActivity I got exception with statusCode=10 that means DEVELOPER_ERROR.
So is anyone have thoughs how it can be fixed?
I ran into the same error implementing Google Pay and I found the answer to my problem here:
https://developers.google.com/pay/api/android/support/troubleshooting
Quote:
The most common error message is ERROR_CODE_DEVELOPER_ERROR. This error message also appears in the UI as a dialog with the following text:
Request Failed
An unexpected error has occurred. Please try again later.
To learn more about this error, follow these steps:
Make sure ADB is installed on your computer.
Make sure USB debugging is enabled on your device.
Connect your phone to the computer using a USB cable.
Run the following command in a terminal or command prompt on your computer:
adb -d logcat -s WalletMerchantError
The response indicates the underlying reason for the error. For example, you may see:
02-26 17:41:28.133 14593 14593 W WalletMerchantError: Error in
loadPaymentData: This merchant profile does not have access to this
feature.
Note: The error only becomes visible in logcat after you've pressed OK to close the alert.
The action you need to take to resolve the issue depends on the error message.

javax.naming.OperationNotSupportedException Java application with Active directory

We have a java application that has multiple threads and that connects to an active directory application to read the data. But most of time, some thread (not all) fails with exception:
"javax.naming.OperationNotSupportedException: [LDAP: error code 12 - 00000057: LdapErr: DSID-0C090753, comment: Error processing control, data 0, v1db1 ];" when getting next page of result (pagesize = 1000)
I googled and found that we should use only one context through the search. We have done the same thing, we are using the same context to get next page, but failing with the exception. Our domain controller is windows server 2008 r2. Is it related to domain controller or are we missing something here?
I got the solution as we are passing control for sorting of data on attribute CN. The sorting control while searching on DC is not supported once we disabled sorting it worked.

OpenJMS : Failed to start database 'openjmsdb', see the next exception for details

Yesterday, I created a topic and a queue on my OpenJMS server, graphically (using admin.sh). I was able to start it with openjms/bin/admin.sh and then clicking on the menus "Start OpenJMS server>Start connections, etc." and even by executing only openjms/bin/startupt.sh (instead of admin.sh).
Today, I deleted all the topic and queue (graphically, by right-cliking on "Delete" on each node Topic and Queue ).
And now, when I type openjms/bin/startup.sh, it displays this exception : http://pastebin.com/PY2wpBkv
Do you know why and how to solve this problem ?
NB : the graphical tool (so admin.sh) still works well.
In fact one must use the classes from package org.exolab.jms.administration (and not use javax.jms.Session's create<Queue||Topic> methods). Read this page : http://openjms.sourceforge.net/usersguide/admin.html

ELM327 returns `?` when trying to use it with ODB Java API

I'm trying to use ODB Java API (this library) to get the data from ELM327 via Bluetooth from my car, but in returns ? on every request, and library raises MisunderstoodException
Here is my code:
socket = device.createInsecureRfcommSocketToServiceRecord(uuid);
socket.connect();
final CustomRPMCommand engineRpmCommand = new CustomRPMCommand();
final SpeedObdCommand speedObdCommand = new SpeedObdCommand();
while (!Thread.currentThread().isInterrupted()) {
engineRpmCommand.run(socket.getInputStream(), socket.getOutputStream());
speedObdCommand.run(socket.getInputStream(), socket.getOutputStream());
runOnUiThread(new Runnable() {
#Override
public void run() {
speedometerGauge.setSpeed(engineRpmCommand.getRPM(), true);
rpmGauge.setSpeed(speedObdCommand.getMetricSpeed(), true);
}
});
}
What's wrong?
I also used the same library for the first steps into trying out OBD, so I can say at least at the time I used it, it worked fine.
From my experience however, getting ? back can sometimes happen with cheap Bluetooth devices (maybe even with expensive ones? never had one). I guess this happens, if some bits are lost during the transmission, because then command will be misunderstood.
What I did to circumvent this problem is setting up a process where I sent all AT commands up to 10 times until I get the desired response of OK (except for ATZ, which will respond with ELM327). As for value requests like RPM etc. I usually just throw away the erroneous values.
That's the short answer, but since such problems with the devices can annoy a lot, I will guide you into debugging the whole process...
Setting up a terminal on windows
First of all to test the functionality of the ELM device, you can send commands to the serial interface directly. On windows, this is possible using for example TeraTerm and then setting up new Bluetooth connection on your windows as a COM device (search for Bluetooth in start -> search box and then choose Change Bluetooth settings or similar). From there, go to COM connections and then add a new one Outgoing for the Bluetooth OBDII device. Wait a bit for windows to calculate the new COM port number, you will need it.
If you cannot find OBDII in the dropdown box, you have to bond your PC with your Bluetooth device first. This can be done via devices and printers, there you should see the OBDII device, so you only have to connect it (PIN usually is 1234).
If you're on Linux, it might be somewhat easier, but I haven't done it :)
Sending some commands via terminal
Once you have your Bluetooth connection and TeraTerm installed, you can start TeraTerm and connect to the adapter. Choose Serial and then the port you just set up. Ensure, that no other device is connected to the OBD adapter (also not your phone). Only one device can be connected at a time.
If connection was successful, you should be able to type letters. Usually, in default settings you should be able to see the letters you type (Echo mode on), but since this is not certain, just type ATZ and hit <Enter>. The ELM should respond with "ELM327" in the same line now (which for me usually results in odd display if echo mode was on, but you should get any response).
From terminal I usually send these commands in order:
ATZ
E1
L1
010c
This will trigger:
Reset of the OBD device
Make sure that echo is on, so I see what I am typing
Make sure Line feed is on, so we get responses in the next line
Request RPM from the vehicle
Between each command I'll check what is the reply of the device. For all AT commands (1., 2. and 3.) it must be OK. If I get back ?, which can happen, I will repeat the command another time. You will see that in such a case the device indeed did not follow the instructions, e.g. did not set line feed on if it was off. So we really have to send it again.
In programming mode on the other hand, we will set e0 and l0 (echo mode off and line feed off), because we do not want to get sent back what we already sent out.

Categories