I am trying to use HubNet for some educational activities, but I can not get the connection to work. The Desktop version does not see the host on the network, and entering the IP address also does not work. On the web version I can host a model, and others can see it. However, when they try to connected they get “connection to host lost” error messages. I tried several different machines and browsers, but no luck. Can anyone help?
Desktop HubNet can be tricky, because it’s not very robust in the face of complex network configurations. Without knowing more about the specific network, my first guess would be that there’s some IT sorcery that is causing your network (probably a school network) to look like it’s one big LAN, when it’s actually a bunch of different LANs, with different people assigned to each. And that confuses HubNet, leaving it unable to find people.
If you really want to make desktop HubNet work, you might be able to work around this by having each machine install Hamachi (which allows you to simulate a LAN over internet). Or maybe you could bring your own router for everyone in the activity to connect to? I know that neither of these solutions are nice.
HubNet Web is intended to make this situation monumentally better. I don’t have any memory of any “connection to host lost” problem like what you’re describing, but I also happen to have made HubNet Web, so I’m much more capable of helping with it, given some more information.
Are you able to get HubNet Web to work with any model? Or are you only running into this issue with your specific model that you’re uploading?
Sounds like I am talking to the right person. Thanks for your reply.
HubNet Web would be just fine with me. It would avoid having everyone install the program, so a preferable solution from that perspective. Unfortunatly I can not get that to work either. I just tried again, using the Disease model. I can Host and Join from the same computer, but another computer gets the same error message. I attach here some screenshots.
Judging by the picture labeled “Computer 1: Joining”, I’m guessing that you’re allowing the “Host” tab to become (and stay) hidden. After your first time doing this, you should have gotten some dialog box, warning you to not do this. But maybe it didn’t appear like it was supposed, or I failed to do a good job of explaining the problem and solution. For whatever it’s worth, I also wrote about it in the FAQ here, but I’ll explain it again here.
Basically: Web browsers de-prioritize allocating resources (like CPU) to tabs that don’t currently have visible content. For most things, that’s good. Even for something like NetLogo Web, that’s usually good. But when it comes to using the browser as a client (or especially as a host) in a real-time activity, that’s bad. If the browser is not giving the tab resources, it cannot send the messages that it needs to, in order to keep the connections with the other clients alive.
The solution to that problem is an easy one, though: Open the “host” tab in its own window of your browser, and ensure that at least one pixel of that tab is visible on your screen at all times.
Please try that and let me know if your connection issues persist.
Yes, now it works. I have to always keep the hosting browser active, otherwise we get the lost connection. OK, I can work with that. Just have to be careful on the instructor side.
I have another problem. When I am trying to upload my own model via HubNet Web I get the error message “Invalid files for upload”. Previously I just used the “Library Models” button on the interface to test my connection issue (which works, see above), not the “Your Own Model” button. I wondered if something is wrong with my model, so I tried it with one of the models from the library. There I get the same error. I tried it with models downloaded via version 7.0.3 and 6.4.0 (different error message). Please see the attached.
Alright. Support for Netlogo 7’s file format isn’t 100% complete yet, in HubNet Web. NetLogo 6 is the better starting place, for now.
The reason your NetLogo 6 model produces errors is that HubNet Web models get programmed substantially differently from standard HubNet models. Ideally, it’s a much easier programming model. But conversion is required from HubNet format to HubNet Web format.
Could you send me the model (saved from NetLogo 6.4.0), and I can help in converting it? You can send it to me in private messages, if you don’t want to post it in this thread.
How can I save my program from NetLogo 6.4.0? When I try to open it with 6.4.0 I get an error message (Unable to open model with current format). In 7.0.3 I dont see an option.
Your earlier message suggested that you already had a copy of the file in the 6.4.0 format:
I tried it with models downloaded via version 7.0.3 and 6.4.0 (different error message).
If you no longer do, that’s fine. You can just send me the .nlogox (7.0.3) version of the file. There’s no automated way to be able to convert from .nlogox back to .nlogo, since the .nlogo format cannot encode information about some things that were introduced in NetLogo 7. But I can convert the relevant parts of your model manually.
In my previous post I was referring to models I downloaded from the library, not my own code. That is, I downloaded Critter Designers from the library using NetLogo Desktop (6.4.0 or 7.0.3), and then tried to upload it to HubNet Web using the the “use your own model” option.
Thanks. I’ll aim to send back a converted version of the model in the coming days.
Is the stuff about writing CSV(?) data to a file necessary for you? Writing files is done in a very different way in HubNet Web/NetLogo Web, and I’d rather not worry about that part, if it’s not actually important for your use of the model.