-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workshop scope - control methodology #4
Comments
It seems like a bluetooth wireless controller can be implemented as a phone app in React native. Here are some tutorial links: Using RN: And here are a couple libraries that provide a BLE (Bluetooth Low Energy) module in RN: UPDATE (2019.04.23) There are also some webapp options worth exploring. Here are some resources: https://github.com/WebBluetoothCG/demos I've never used RN nor built a native app, but I'm willing to spend a day or so to spike a proof of concept. That might give us an idea on how deep this 🐰 🕳️ goes. And of course, I'm always open to feedback 👍 |
I'd definitely be free to review anything you come up with if you think that would be helpful :). My experience with React Native is pretty minimal, but I'll help how I can! Our alternatives if crossplatform BLE doesn't pan out would be obstacle detection with a sonic sensor. Either way, getting to the point where we're thinking about how to steer our car is a big win, and would still be months down the road. |
I spent a day on this, and I got blocked on a few issues in both iOS and Android development. My general takeaway is that without some native-app expertise, this will take a lot more time than I had anticipated 😬 So here are some options that I see moving forward:
I tried following the Expo guide linked in my comment above. I documented some details of my attempt below, in case anyone is interested in exploring or providing feedback. I created a repo here: https://github.com/modulitos/toycarcontroller where I followed the step-by-step instructions. iOSI made it to the last step, where I needed to run:
There seems to be an issue with linking the React Native bluetooth module here: modulitos/toycarcontroller@a9e38a7 My intuition here is pretty limited, since this is my first time doing mobile development. AndroidI made it to the last step on the Android app, and the app successfully built after connecting my Android phone and running the command
But it looks like there was still an error in getting the app to run. I suspect this isn't caused by the build, and might be fixed by building out the app logic. |
Yowza! Ok, thanks for this, @modulitos. It seems that a simple sensing robot would be a good first step, with an eye on making it remote controllable only if/when a solution presents itself. I'll be at OxidizeConf, and will ask around while I'm there if anyone has any ideas. Assuming nothing ready-made drops itself in our laps, that would mean the project would be simpler:
There's nothing stopping us from adding remote controllability to the project as a separate step later on if there is interest. WDYT? |
@U007D Yes, that sounds like a great path forward 😁 I think starting on the Rust modules will give us some time, and motivation, to figure out the sensory input. If we're lucky, the Expo team will ship Bluetooth support by the time we are ready to make that decision 🤞 |
Note: this was originally posted in our chat UPDATE Below is a proof of concept to demonstrate how a static website using Web Bluetooth can connect with a BLE device. Here are steps to repro the proof of concept: Download the "BLE peripheral simulator" app on Google Play (sorry, I didn't explore an iphone option): This app allows us to test the Web Bluetooth without needing a BLE Peripheral Device. Note that our car will eventually be the BLE device that is simulated by the app ;) Once the app is downloaded, open the app on your phone. Then on a separate machine, visit this website using Google Chrome: https://webbluetoothcg.github.io/demos/heart-rate-sensor/ Click the "Get ❤" button in the center of the web page. A pop up will appear, scanning for BLE devices, and your phone should appear. Click on your phone to pair with it. Within the phone app, click "Heart Rate Monitor", change the "Heart Rate" number to any number you'd like (eg: 42), and click "notify". The web page should display the number 42 🎉 As for next steps, I think a reasonable MVP is to control an LED that is mounted to our RISC board over Web Bluetooth. There is a repo of web bluetooth demos here: I'm going to explore this demo, which is for a controlling LED's over web bluetooth: I'll also need to read up on GATT, which is the protocol used by Web Bluetooth: Unfortunately, it may not be trivial to implement the GATT protocol for a BLE device: https://www.oreilly.com/library/view/getting-started-with/9781491900550/ch04.html#gatt_hrs_img Or we can try reverse-engineering the Android API to see how it's implemented. Here is the Android lib for a BLE GATT implementation: I'll also need to start reading up on the Rust embedded discovery book, because I have no idea how to implement BLE devices on a RISC board. |
interactive control (wireless, via bluetooth from phone?)
autonomous (using on-board sensor, choose random direction)
Driver is whether we can find/build a bluetooth remote control solution on the phone. As this is not a part of this particular workshop, any tech is fine, as long as it is reliable and usable by both Android and iPhone users.
The text was updated successfully, but these errors were encountered: