#1 by Rainbow
Hello, I'm really sorry to ask another foolish question. We hope to use our personal computer as a personal server, so that our computer and the devices used by the participants (we have prepared the tablet in advance) are in the same LAN built with a router, so that the tablet can open my room. For example, after running "run prodserver 8000" normally, I can create a room and obtain the "Room wide URL". My computer has successfully connected to the local area network, and when I connect my tablet to my local area network and enter my Room wide URL, it shows "Access Error". In other words, even if my tablet and my computer are on the same LAN, my tablet still cannot enter the game normally. I don't understand why my tablet cannot be accessed properly, or should there be any other actions before just establishing the server? I searched online, but couldn't find the operation that meets my requirements. I just hope my tablet can access my room on the LAN, not on the public network (due to some restrictions, I am not very convenient to use cloud servers). Thank you very much for your help! Once again, offer my highest respect.
#2 by gr0ssmann
You must run "prodserver 0.0.0.0:8000"
#3 by Rainbow
Thank you very much for your reply. I tried using "otree prodserver 0.0.0.0:8000" to start the service, but it seems to have not improved. My tablet still cannot enter the room normally and still shows an access error.
#4
by
BonnEconLab
Running “otree prodserver” (no need to add the 8000 or 0.0.0.0:8000) on an arbitrary (Windows) PC in my university’s network and accessing it from a different PC on the same network works flawlessly. Of course, the firewall settings (both on the PC to be used as the server and of the network) must permit this. This seems to be the case, given your previous post regarding the “Invalid room specified in url” issue. So, I am puzzled. What happens if you simply try to open http://<put.your.oTree.server's.IP.address.here>:8000 in the tablet’s browser (i.e., without the room-specific part of the URL)?
#5 by Rainbow
Dear BonnEconLab, thank you very much for your help. When the tablet was not connected to the local area network, the problem he exhibited was the same as the one I encountered, both of which were "access errors", as if they were not connected to the local area network. The reason why I am confused is that the computer, as a personal server, was previously connected to a tablet as a personal server and was able to function normally at that time. However, at that time our computer's OTree version was very low, so this time we updated the versions of OTree and Postgre databases. So I think there may be no issues with setting up computer firewalls and establishing a local area network? (Or may there have been changes in this area due to version updates?) However, during this unused period, for some unknown reason, the IPv4 address of my computer changed. Therefore, the website that my tablet needs to connect to now is different from before, resulting in the problem of illegal web pages from before. But my new IP address: 8000 has been showing "access error" on the tablet, and I don't understand why, so I hope to seek help from everyone. (I'm sorry my English is not very good, so sometimes I use a translator. I hope I can express what I want to express clearly.)
#6 by gr0ssmann
@BonnEconLab: AFAIK oTree binds only on localhost, so the 0.0.0.0 is indeed necessary to achieve local reachability. @Rainbow: Oh, this sounds like you are trying to access oTree using the global IP address of the server (which, probably, is behind a NAT and is occasionally provisioned with a new IP address by your provider). However, for local access, you should use the LAN-internal IP address. It typically starts with 192.168 or 10. The URL should be http://192.168.x.x:8000/[remainder of the URL].
#7 by Rainbow
@gr0ssmann:Thank you very much! I retested it based on your suggestion and it was really successful. My tablet can enter normally. I am really touched, thank you very much for your help!
#8
by
BonnEconLab
@gr0ssmann wrote: > @BonnEconLab: AFAIK oTree binds only on localhost, so the 0.0.0.0 is indeed necessary to achieve local reachability. I just retested this not at my university but using a Mac to run oTree and a tablet to access it in my home WiFi: otree prodserver suffices for the tablet to access oTree via http://192.168.x.x:8000. With otree devserver, by contrast, you need to execute otree devserver 0.0.0.0:8000 if you also want to be able to access the running oTree instance from other devices.
#9 by gr0ssmann
@Rainbow: I'm glad to hear that. I thank BonnEconLab for pointing out the mistake in my previous response: If you run the prodserver, you can omit "0.0.0.0" after all. Indeed, this is undocumented behavior: The default of devserver is to bind only on localhost (127.0.0.1), while prodserver binds on * (0.0.0.0) even when the host is not specified. By the way, this is only true for IPv4. The oTree prodserver is not reachable at ::1.
#10 by Rainbow
It's really sad that I've encountered difficulties again... On my own computer, my Ethernet Ipv4 address is 192.168.10.2. With this IP, all five of my devices can connect and operate normally; My WLAN 2's IPv4 address is 192.168.10.6. With this IP, three out of five can connect, while the other two cannot. Although I don't understand why, based on everyone's response to me, I think I should use IPv4 over Ethernet as the website address. But a magical thing happened. On another computer (another device we were planning to fix as a server), connected to the same router, its Ethernet Ipv4 address was 169.254.xx.xxx, and although the IPv4 address of WLAN 2 was 192.168.xx. x, neither of these two URLs could link any devices. I feel very confused