Connect to device without internet (wireless) - android

I'm currently working on a project, involving a Raspberry PI and a tablet. Now the tablet should be able to communicate with the Raspberry PI, even though it does not have internet. I was thinking on Bluetooth first, but that's not really an option either, is there something you can suggest me?
Many thanks.

If you make the raspberry pi a wifi access point, the tablet can connect to the pi, however unless the pi has a connection using ethernet you will have no wifi whatsoever. Adafruit has a reasonable guide to actually getting setup. I havent tried it, i had just looked it up earlier this week and it was still an open tab.
https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/what-youll-need
If you havent got a wifi usb, nor a bluetooth, youre kinda out of luck, you could if you have the skills, hook up the audio output from your tablet to the pi's io (may require more then just wire, im not sure the amps, voltage, etc), and write an app that translates data into the signal to tx/rx over the audio cable, to make it wireless you could use ir transmitter/receiver pair, but again this is a lot more work.
Update from comment: alternately the tablet could be made a hotspot, and you can connect to its wifi using the pi, however, since the fastest speed of your whole setup is your 3g/4g connection itll not get better then that regarding speeds, im not sure if its possible to connect to wifi with tablet and push out hotspot for the pi to connect through, but you could try that out as well

Related

Control Raspberry Pi with phone

I am new to Raspberry Pi. I wish to turn on/off a light and play some sounds on the Pi from my phone both Android and iPhone. It is a kids toy that I am prototyping.
I need the setup to be easy for any user to download the app and just connect to the Pi with little trouble. I dont want the Pi connected to the internet so no external api services.
I have search for tutorials but surprising nothing other than using a service.
Could anyone poin me in the right direct. I dont have a preference over bluetooth of wifi. Just one that is easy for a kid or parent to setup.
Thanks
You mentioned playing sounds, you need a beeper (if those sounds are more complicated, use a speaker). Also, you need those lights connected to GPIO (USB is also a viable option, by simply turning on/off the USB port).
Issuing a USB Hub class request (CLEAR_FEATURE PORT_POWER) to port 2 on the LAN9514 will > deactivate the USB output power switch.
There's an app for that:
https://github.com/codazoda/hub-ctrl.c
This is a bit harder to setup, but you don't need any soldering with this. Then, you need to setup an AP for the kids to connect to the Raspberry Pi's website (should be a website, app is harder to make). Also why you don't want the Raspberry Pi to connect to the internet?
Are the lights you want to turn on/off wired to the Raspberry Pi (for example via GPIO)?
You need to install one of the open source automation software (like OpenHAB or Home Assistant, etc.). Disable port forwarding to the Raspberry Pi (usually you need to do this port forwarding, so here you don't need to do anything).
In this case, the IP is a local IP, and you get local access only.
Then probably you need is already implemented by someone from the community, or you need to develop a simple script to achieve what you want.

Android tablet ethernet connection for network communication?

It seems like my Samsung tablet rejects and loses its ethernet connection when I connect anything other than internet via micro-usb to ethernet adapter.
I'm trying to connect Raspberry Pi and the tablet via ethernet cable and stream video from the pi to the tablet with network stream in my app or VLC i.e. http://xxx.xxx.xxx.xxx:port#
Is there a way for me to do that with Samsung tablet? Samsung tech has told me that their tablets support ethernet connection only for internet. And it loses its connection if there isn't any response to ping, I think.
I'm considering rooting too. If I root, how can I disable the ping or send imaginary response to the ping when I connect ethernet cable?
Any help would be greatly appreciated!
I made recently roughly similar setup and got it to work.
I used Samsung Tab S2 (and later Samsung Tab S3) as a tablet and Odroid XU4 as a single-board computer instead of Raspberry Pi since I needed more processing power.
Ethernet connection worked when I used a fixed IP in the tablet and did everything in correct order:
First, disable Wifi and mobile data
Connect Ethernet and set fixed IP in Settings
Open video stream
Enable Wifi and/or mobile data
Use another browser tab/app to connect to the Internet (the Ethernet connection stayed alive in my tests)
If necessary, use a port forwarding app to share the video stream to other devices over Wifi
However, I ended up using USB Tethering instead of Ethernet. It was more simple and more reliable solution. The way I did it is documented here:
https://github.com/FinweLtd/mjpg-streamer/tree/master/scripts#mobile-streaming
Both solutions worked without rooting.

Accessing WiFi LAN (no gateway) and mobile network simultaneously

I'm aware it's been asked before (with limited or no solution) but I haven't seen any recent updates and I think my scenario is unique so I'll start a new thread.
I have a Raspberry Pi and it's functioning as a hot spot among other things. By design, DHCP isn't handing out a default gateway. My use case is one or more devices interacting with the Pi as a server.
One of the connected devices will be a mobile device(edit: running a custom app of my design which is part of the total solution), and that device will maintain its cellular connection, not for tethering or routing but so that the application can access internal and external resources simultaneously.
Currently:
IOS: This works exactly as I expect on IOS - it senses that the WiFi network doesn't have a default gateway and sends external traffic over cell.
Android: This doesn't work at all. Android stubbornly sees WiFi connected and disables cellular, even with no default gateway.
Windows Phone: Kind of a hybrid. Both networks stay up but my scenario has a DNS entry in public DNS, and a public site links to a resource on the Pi. If I link to the resource directly using the WiFi IP address of the Pi, it works fine (although this causes other issues related to security). If I link via a FQDN, I'm actually not sure what's going on. It doesn't resolve from the web browser although every networking utility I've installed on the phone for troubleshooting correctly resolves the FQDN to the Pi address via DNS.
Hope this makes sense. The question: How can I enable this functionality across the board in 2015? :) For my purposes, the Pi as a private nonroutable hotspot works better than WiFi direct or Bluetooth. And remember I'm not asking the phone to ROUTE; I need my custom application to be able to simultaneously connect to the Pi and to the public Internet. I want all the phones to do what IOS does in this regard.
My current scenario is the Pi hosting a web page (among other things) and that's my preference, but can this even be solved natively?
You say that this is not a tethering or routing situation, but if you think about it, it really is both.
It is routing because the traffic from the phone needs to be routed to one of the two interfaces. There may not be routing through the phone, but it's still a routing problem. Fortunately, it seems that the routing part is working on all three platforms.
It is also an unusual form of tethering. The only differences are that traffic does not originate from the Pi, but from the phone, and that the Pi rather than the phone acts as the access point.
Thinking of it in terms of tethering is important because it shows that the Android CAN have WiFi and cellular active at the same time (at least in hotspot mode, but probably also in client mode). In this respect, my answer isn't complete - I can't tell you HOW to accomplish that.
As for the Windows phone problem you mentioned: in order to troubleshoot that, first identify where the DNS server is located that knows about the Pi's FQDN. Does a public DNS server know about it, even though it is obviously on a private network?
There are two possible explanations for your observation:
There is no public DNS server that even knows this FQDN. In that case, IOS is probably using something like mDNS to locate the Raspberry Pi.
There is a public DNS server that knows this FQDN. In that case, maybe Windows Phone checks the DNS reply for martians and rejects it, thinking that it is an attack.
Either way, what you'd really need is to have two separate DNS infrastructures. One way to do this is to include a small DNS server (dnsmasq maybe) with your app, and configure a forwarder for the zone with the Pi's FQDN to forward to the Pi's IP address (which would have to be hardcoded, obviously). All other requests should go to the normal DNS servers.
Another way might be to not use DNS at all, but use the hosts file instead.
For Android phone you can use application named "WiFi & Mobile Data Switch" (https://play.google.com/store/apps/details?id=com.totemsoft.wifimd). For me it solves the problem of simultaneous connecting to internet (via mobile data) and to local network (via WiFi, internet is inaccessible via WiFi). This applications works ok on Samsung Galaxy A8. I hope, my comment helps to somebody.

Connecting a Raspberry-Pi to Android phone wirelessly

I am trying to wirelessly connect my android phone to a Raspberry-Pi, so I can then make a controller app to interact with the RPi.
I have just bought a dongle, as I was thinking of using Wifi-Direct. However this doesn't look as simple as I originally thought.
There's not much information out there on how to do this, and I am completely new to RPis.
I have found the odd tutorial like this: https://www.youtube.com/watch?v=6GPv8TfZqe4
But it seems overly complicated and I am not sure if they applicable to my dongle.
I am thinking there must be a more simple way to do this(e.g. through wpa_gui on Raspbian)
Any suggestions on how I could achieve this?
You can try:
SSH to raspberry Pi with given credentials (if both devices are connected to the network... but that may not always be doable)
Setup web API/app on RPi and use it via browser on Android (like https://github.com/NeonHorizon/berryio )
Use Bluetooth UART: Adafruit has a full blown Bluetooth UART board, and Chinese make many slave (or master) UART serial boards. This way you could open a serial connection from the phone - and with luck you would get the terminal which by default is cloned to UART in RPi (or it would get your script running on Pi and handling incoming UART messages).

Is it feasible to connect some devices to Android or Iphone smartphone through Wifi?

I'm doing a research because I want to develop an app to which different devices connect.
The app can be an Android or iPhone smartphone. It will be for mountain equipment devices and sensors, so no wifi router is availabe. It needs long range, so Bluetooth is not an option.
I'm thinking on creating a hotspot in the smartphone and connect the devices to this hotspot. In this case, I'm thiking of this way of doing it:
Programatically create the hotspot in the smartphone. In Android, like this: http://www.whitebyte.info/android/android-wifi-hotspot-manager-class
Set up the name of the hotspot in the devices so they know where to connect. Pressing a button, they connect to the hotspot.
The android device broadcasts its IP, so devices know where to connect.
Devices connect and send the data.
I think this could be a real scenario, but I'm worried about:
Maybe there's a design flaw in my scenario that I'm not seing.
Batteries on the devices: how do batteries behave through "intensive" use of WIFI? (sending small amount of bytes of data every five minutes, e.g.).
The ability to replicate this scenario on an iPhone. Can it be done, or should the user manually create the hotspot to do this?
Any other feedback that I couldn't be thinking of.
Thanks.
Yes, on Android all of that can be done and should work fine.
Yes, you can programatically configure the hotspots info in the client.
Another way to make the connection (other then hotspot broadcasting its IP) is for the hotspot to reads it ARP cache, i.e. parse the cache to find the IP of all of the clients connected.
Battery could be a problem. That doesn't really sound like 'intensive' use of the wifi, but it will still consume a fair bit of battery (I find that even just having the hotspot enabled draws the battery).
I don't know the answer for iPhone.

Categories

Resources