Skip to content
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

ngrok and connection to 01-Light #249

Open
philiphusseinn opened this issue Apr 17, 2024 · 2 comments
Open

ngrok and connection to 01-Light #249

philiphusseinn opened this issue Apr 17, 2024 · 2 comments

Comments

@philiphusseinn
Copy link

I've encountered the following problem when setting up the server and connecting my M5 Atom to it (I'm so green with these things). So I've flashed the M5 Atom and set the ngrok server to the static domain and in ngrok dashboard it shows that this tunnel is active. So next step will be connecting to the 01-Light's wifi (on the same computer where I'm running the ngrok server) and when I try to enter the server address in the captive wifi window it shows an error. So it can be these two issues (if I understand it correctly):

  1. Either you can't run ngrok and enter the 01-Light wifi on the same computer (but it would be so unlogical then), because when I'm done setting up the server with poetry run 01 --server --expose next I was disconnecting from the working wifi and setting up the 01-Light.
  2. I wasn't entering the server address right in the 01-Light 01OS window. Should I then be entering the IP address of the server of domain name of something else?
  3. Also the 01-Lights captive wifi window isn't popping up after some trials. How do I evoke it? (Tried forgetting the network)
    Will appreciate your help!
@Juand201
Copy link

Juand201 commented Apr 18, 2024

Hi Philip, first of all I have to say im not an expert and just using openinterpreter and 01-light (M5 Atom ) since few days, so sorry if im wrong with something; but this happend to me yesterday so may be i can help .... if I understod you well you can use the 01-Light correctly in your LAN but you can not use it with ngrok, right?

As far as i know you have 2 options:

if you still have access to the 01-light captive wifi window you have to put the server address but as far as i know includding the port, for example: "your-static-domain.ngrok-free.app:80" .... for some reason here with ngrok (just with the 01-light config using ngrok) you have to use port 80 instead of 10001.

if you dont have access to the 01-Light captive wifi window and you are using arduino for flashing the M5 Atom (this was my case); you have to edit the client.ino file and change this 2 lines:

String server_domain = "your-static-domain.ngrok-free.app";
int server_port = 80;

and flash/upload again the client.ino file to the M5 Atom .

@Rob-Milliken
Copy link

Rob-Milliken commented Apr 30, 2024

Phillip, are you still having issues?

I've had the same problems but have figured it out, at least for my set up. First, it is annoying that the wifi window appears blank. I'm thinking it's because it take a while to grab all of the ssid in your area. So here is what worked for me. Find "if(WiFi.scanComplete() > 0) {" in client.ino and replace it with "if(true) {" - my debug stuffs says that WiFi.scanComplete() is a negative number until it can generate the list. The way it was, if it can't find a list, display not HTML, just a blank page! No fun. Now, with this fix, you may have to still refresh a few times to get it to generate the ssid list for you (on my android smartphone, I just tucked from the top of the screen then downward to refresh), but you should see "other" to change to a list after a few tries.

In regard to ngrok, I tried foreve's to get that to work with http. Nope, no doin. It did work though with TCP. You may have already figured that out, but maybe it'll help someone. The format that I used on the command line is:
ngrok tcp 10001
You'll then need to put your tcp thing in the format of "tcp://#.tcp.ngrok.io:######" when it asks for server address. I don't know what's up with that being hard coded in client.ino since ya gotta type it in anyway. Anyhoo - whalalio, it started workin' for me! You may, of course want to check firewalls, but I figure you probably already have. I hope this helps you and maybe some others. Now it's solderin' time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants