-
Notifications
You must be signed in to change notification settings - Fork 1
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
Internet and sheep at the same time #38
Comments
Very unbaked thought - if users could connect to the brainbox via bluetooth then they'd still be able to connect to the internet via a normal wifi network. Obvious downsides being that not all laptops have bluetooth capabilities and we wouldn't be able to serve the docs and editor as webpages in the way we do now... |
There is a bluetooth API for webpages to connect to browsers so it is conceivable to host sheep on the website and then connect through bluetooth that way which would still lead to the same intergrated experience: https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API However the API for the last 7 years has been marked as "experimental" and only works on chromium based browsers which is like 90% of all browsers. There are revisions made to the specification on about a 1 month cadance at the moment. Maybe this is too experimental. Alternative would be electron. |
Bluetooth dongles for laptops are also very inexpensive so I don't think it is a blocker if some laptops don't have them. Personally I am leaning towards repackaging sheep as an electron desktop app which works over bluetooth. This way you don't need internet to work. Downside is that it will require custom software to be run on user machines which is okay if we are going to provide them with laptops. Not sure if we would want to have a legacy mode where shepherd comes up either as a WAP or with bluetooth. |
I started rewriting shepherd/sheep a few times a while ago using different technologies like python with fast-api or rust. These are the repos (they're private but message me and I'll give access) I started them as the general brainbox structure was confusing, old, and not that well built. Although it worked fine it can definitely be simplified and improved. I'll hopefully have some time over the summer to take another look and help out. |
oooh nice, would you mind giving a summary of what each of these 4 are? |
Sure https://github.com/fenjalien/shepherd-rs - An implementation of sherpherd but in rust using Actix(https://actix.rs/). I'm pretty sure the API to start, stop, upload, delete and output are working. I didn't touch anything todo with the text editor. https://github.com/fenjalien/robot-rs - An implementation of https://github.com/fenjalien/brainbox - I'm pretty sure this was just a dump of the above two repos along with additional stuff i was testing out. Or it was an attempt at creating a proper structure and finding a way to fit everything together.(i don't remember how far i got) A quick lessons learnt (from terrible memory)/points i would like to make
|
I realise that this wasn't the best place to dump info woops. We could just provide wifi dongles, pretty sure that allows connecting to two networks at the same time. |
I hadn't considered two wifi networks, my only concern would be DNS. I don't know if browsers would then understand how to navigate to If it could be made to work maybe that would be the cleanest solution. |
Thank you for all of the points about the various repos. I do quite like the idea of
I very much agree with you that this is bad. It feels to me like implement/maintain a whole seperate module with a messaging system is alot of work. Do you think the pay off is worth it? Reset is hacky but its one function. Maybe a simplier way would be to have shepherd instanciate robot and then you just do: import robot as R
R.motors[1] = 100
R.see() The robot object lives within It even makes the usercode simplier as there is no Downside is we would need to be very careful to clear all the state of the robot object between rounds. Not sure how to do wait for start, at the moment it is possible though I've only ever seen one team ever do this to init stuff with the robot before running robot code. I do think being able to pre-init is essential as a team might want to set servos to some position before start or all kinds of other hw config so their robot fits in the box. Maybe I don't know enough rust but I'm not 100% sold on I do really like |
This would also persistantly let us show stuff like the battery charge in the |
There are plenty of examples of tethering the PI over Bluetooth and then sharing the network over bluetooth. I'm assuming that the reverse is possible, that the PI can act as a bluetooth router routing to WiFi. If so then we have two options.
Note that everything said above including issues also applies to solutions with multiple wifi: solution 1 would have two wifi cards in the PC, solution 2 would have two in the brain |
I did not know this. This would be far better than anything proposed above (assuming the thinkpads we have support bluetooth). I think option 1. Providing everyone with the WiFi key at the competition is a "low-tech" but reliable way of getting everyone simple, un-complicated internet. Option 2 sounds like something which will break on competition day in some magic way but we will only find out about it breaking then. Maybe taking everyones ability to write code which is worse than arena USBs not working. |
https://elinux.org/images/1/15/ELC_NA_2019_PPT_CreatingBT_PAN_RNDIS_router_using_OpenWrt_20190814r1.pdf talks about setting up a PAN |
https://elinux.org/Bluetooth_Network A PAN network is limited to 7 clients and provides substantially less bandwidth (~700Kbit/s) than other WiFi networks. |
Sheep is about 4.5MB at the moment but that can proabally be brought down to 3MB without too much pain. We could then cache the whole of sheep in the browser and so subsequent loads would not be anywhere near as bad. The first load would be a bit painful at 30 seconds but after that fine. The rest is a 600x400px jpg and some text so 700Kbit/s should be fine for that. |
I guess we would need to test if it can keep 700kbit/s over a 6m arena with people moving around. 700kbit/s is fine but I don't think we want to go much lower. |
I tried the bluetooth on the PI to a Switchbot and it had greater range than the house Wifi, albeit at the very low datarates used by switchbot. For dev work nobody is really that far away from their robots, especially when loading the page for the first time. For the competition, the arena wouldn't be run over BLE it would still run over wifi. We should keep the wifi as an option because its far easier for people to set it up. As long as the Bluetooth is setting up PAN rather than using something "Bluetooth specific" then everything above layer 1 will be untouched and work with either stack. |
The memes are
True
. A large part of independent problem solving in the 21st centry especially with programming is being able to google effectively. The current system design stops this self lead exploration.It also puts more resistance to individuals contacting us through the forum.
Therefore the users machine should be able to remain connected to the internet.
The following properties of our system: are good (though maybe some are obsolete now that we ship laptops?)
Would be nice to haves in a new system:
This thread is to hash out ideas for potential solutions
The text was updated successfully, but these errors were encountered: