WebUSB disconnects on Android after a while - javascript

I have implemented the web USB API for the USB-to-TTL chip CH340. It works pretty good on the PC but when I connect my phone to the chip (using direct cable and/or OTG cable) the API will disconnect after a minute or two. This doesn't happen if I use a Serial Terminal App on the same phone. Same will happen on multiple Chromium based browsers.
And as soon as I physically disconnect the chip from the phone it will freeze and restart the phone.
Here's my beta test site: https://grovkillen.com/webusb/

This behavior shouldn't happen (especially the freezing and crashing part) and is likely a Chromium or Android bug. Please open an issue on crbug.com and include any crash IDs from chrome://crashes in the report. Reply here with the bug link so I'm sure to see it.

Related

Sending RF signals and receiving them back using mobile application

I am trying to make an app which constantly makes the transmitter of the mobile phone send out RF signals and receive the same signals when they are reflected back and detected by the receiver of the mobile phone.
I tried using my brain and searching on web to see how this is possible but i am not able to find an answer, so is it possible to make such kind of mobile application which can control the transmitter and receiver of mobile phone or even Bluetooth and WiFi because those are also RF signals!
if yes, please guide me briefly or share a tutorial link!
In my experience with iOS there is no device with RF chipset. So for iOS the answer is NO. I checked google too (several searches).
You can see the official specs of iPhone X. Nothing that related to RF.
If you really want to go far, check for external hardware (I hardly believe you’re going to find any)
You also have to be careful and make sure that you won’t breaking the iOS AppStore guidelines or your app will get rejected.
Good luck!

React Native Expo building very slowly

I've recently noticed my build time has increased considerably, sometimes taking a full minute to load. On the console I still see "Building JavaScript bundle: finished" fairly quickly but the screen takes much longer to refresh. Is there a reason something like this would be happening?
Try using Expo in a Simulator on your development machine and determine if it is taking as long as on your device:
If it is faster than on your test device, then you should check the
network connection on your test device
If it is as slow as on the test device, then you could try to remove node_modules and reinstall them with 'npm install' or 'yarn'. Expo will be redownloaded aswell as all other packages.
In my case, it was a different solution.
I followed the instructions given by jimmylee on the Expo SDK forums, which say:
If you are behind a VPN, try disabling the VPN.
If you are using windows 10, run CMD on your machine and type
ipconfig. Take a look at the first Ethernet Adapter. If it doesn’t say
Ethernet Adapter Ethernet it means Expo is taking the IP address of
something else.
To fix this, go to network connections and disable the adapter that it
should not be pointing at.
Connect your computer to the network and your phone to the same
network. Restart Expo.
So, go to Settings > Network & Internet.
Click Change Adapter Options:
Then disable the unneeded Ethernet:
Then restart Expo.
If the connection is made but bundle building is very slow - Try disconnecting from the network both devices, the system and the mobile, and reconnect. Also, don't forget to clear the 'recently in development' projects and start the project again.
It will certainly increase the speed of building by far, especially for windows it works very well.
I was going through the same problem.
I used expo on multiple devices and clearly it depends on the device also, i.e, whether it is able to handle it or not.
Second, for the slow device, i came up with a solution.
I just turned off the fast Refresh.
Fast Refresh keeps a watch on the development side and keeps reloading whenever we make a change.
By deactivating it, we need to refresh the app on our own. But this helped me.
Due to multiple refreshes and continuous bundling, expo gets slow (as per me) thus disabling this feature may help (infact helped me a lot).
STEPS TO DO THAT;
In your expo go app, shake your device. An option panel will open.
There will be an option to disable fast refresh. Simply click that and you are done.

Web app not working on Chromium in Chrome OS

I'm working on a web app for note-taking called VideoNot.es (http://videonot.es). This app is build with AngularJS and webapp2 and hosted on the Google App Engine.
My app is working fine on Chrome for the major OS (Windows, Mac, Linux) but some users have started to report issues with Chrome OS (mainly teachers with GAFE accounts).
I've decided to run it in Virtualbox and there is effectively an issue.
The app never receives answer send over the Google Channel API (https://developers.google.com/appengine/docs/python/channel/overview) while the backend is logging that it sent it. I had received reports before we moved to it so it is not really link to it.
I really don't understand what is wrong here.
Thanks for your help.
If it's a bug in the Javascript, you'd want to file it on the issue tracker. I haven't noticed much progress on Channel API bugs, so I wouldn't expect much though.
I'd recommend working around it by polling, or another solution, like Node.js hosted elsewhere.

SignalR on mobile web?

I'm evaluating SignalR technology for use in our new product (mobile web application for the broad audience, among other things it needs a real-time chat on some pages).
I've followed the guide to create a very basic chat demo.
Then I deployed the demo on my IIS, and started chatting to myself.
All clients were on the same WiFi network.
Desktop browsers worked more or less OK.
However, Safari on iOS 4.2, and IE on WP7.10 - they both sucked.
Sometimes nothing happened when I pressed the "post" button.
Sometimes outgoing messages were sent OK to the desktop firefox, however there was no incoming messages.
Maybe I'm missing something obvious? Maybe I need jquery mobile instead of the normal one? Maybe I should just tune the IIS/web.config/whatever, and the SignalR will flourish and start to work flawlessly even through the crappy mobile internet?
Or does it mean that since it doesn't work even while on WiFi within a single hop from the web server, I should throw SignalR away and just write some JavaScript to poll a JSON endpoint for new messages?
Thanks in advance!
I have been developing an app with phonegap (that means that uses the Safari browser) and SignalR for Android and IPhone. The major issue I had was with iOS 6.x because SignalR did not connect with default config. I have found a workaround for that and I had explained it here. Let me know if you find it useful.
This code will simulate a connect, check for messages, disconnect and wait 5 secs to solve the iOS issue.
In js add
$.connection.hub.start({ transport: 'longPolling' }).done(function (myHubConnection) { });
and in Application_Start() add
GlobalHost.Configuration.ConnectionTimeout = TimeSpan.FromSeconds(1);
Microsoft.AspNet.SignalR.Transports.LongPollingTransport.LongPollDelay = 5000;
RouteTable.Routes.MapHubs();
Not all mobile browsers (e.g. android, opera mini) support websockets. You'll find a nice chart of supporting browsers at http://www.hanselman.com/blog/YourUsersDontCareIfYouUseWebSockets.aspx

Problem with DWR and Android-Browser

I am experiencing a problem with accessing an application from the Android-browser.
The application uses DWR to persist connections to the clients that are connected with it.
Everything works fine for me, except that if the application does not send any data to the client on the Android-phone for 2 minutes, the connection seems to be lost and no data arrive at the client. The same scenario works just fine on Firefox, Opera and Chrome. If the pause between two data transfers is less than 2 minutes, it works just fine.
So, now my question:
Is there some timeout setting for the android browser that I am missing? Or is this some built-in bug/feature/whatever that I cannot circumvent?
I know that I could prevent this from happening with some sort of heartbeat, I would just like to why this is happening.
Thanks in advance, Max
btw: Everything (server, clients) runs on my machine and I am testing this on the android emulator with Windows XP
Android emulator version 1.10 (build_id CUPCAKE-150240)
Could it be that the Android system is garbage collecting your activity and thus loosing your web browser and closing the persistent connection?
Perhaps you could check this by looking in you logcat (on android end) or webserver logs (on remote end)?
if this is the case, you would need to add reconnect code into the onresume/onstart method in android.

Categories