BeamNG / BeamNGpy

Python API for BeamNG.tech
https://beamng.tech
MIT License
258 stars 46 forks source link

BeamNG.research Connection problem #28

Closed autonomobil closed 3 years ago

autonomobil commented 5 years ago

I just downloaded (via SVN) the BeamNG.research repository. https://projects.beamng.com/projects/research/files is empty. In a conda enviroment I installed BeamNGpy via pip install beamngpy.

When I try the example code with west_coast_usa, BeamNG starts but after a short time it threws the following error:

055.319|D|GELua.scenario_scenarios.scenarios|should run: false; state: running 055.322|E|GELua.core_levels.levels|info.json missing: /levels/garage/info.json 055.325|E|GELua.core_levels.levels|No entry point for level found: /levels/garage. Ignoring level. 055.442|E|GELua.ResearchCom|Error reading from socket: closed 055.472|E|GELua.core_levels.levels|info.json missing: /levels/garage/info.json 055.473|E|GELua.core_levels.levels|No entry point for level found: /levels/garage. Ignoring level. 055.613|E|libbeamng.lua.V.ResearchCom|Error reading from socket: closed 057.143|I|libbeamng.lua.V.ResearchVE|Trying to connect to: localhost:64257 059.355|I|libbeamng.lua.V.ResearchVE|Could not connect... 060.001|I|GELua.util_researchGE.ResearchGE|Trying to connect to: localhost:64256 062.317|I|GELua.util_researchGE.ResearchGE|Could not connect... 063.386|I|libbeamng.lua.V.ResearchVE|Trying to connect to: localhost:64257 065.533|I|libbeamng.lua.V.ResearchVE|Could not connect... 065.735|I|GELua.util_researchGE.ResearchGE|Trying to connect to: localhost:64256 067.760|I|GELua.util_researchGE.ResearchGE|Could not connect... 074.911|I|GELua.util_researchGE.ResearchGE|Trying to connect to: localhost:64256

What could be the problem?

alessiogambi commented 5 years ago

Hi,

for future reference "https://projects.beamng.com/projects/research/files is empty" has always been the case. The correct files are under: https://projects.beamng.com/projects/research/repository/show/trunk If BeamNG.research starts, then you have the files that you need.

Regarding "055.442|E|GELua.ResearchCom|Error reading from socket: closed", it's a wild guess but did you check if you have firewall rules which prevent opening sockets from python?

autonomobil commented 5 years ago

Hey, thanks for the answer

At the bottom of the beamng research homepage under DOWNLOAD it has a link to https://projects.beamng.com/projects/research/files ...so that should maybe be changed

I will check my firewall

oooooverflow commented 5 years ago

Excuse me. I encountered the same problem, may i ask whether you have solved it?

oooooverflow commented 5 years ago

yeah,my problem is exactly the same as yours.

043.818|I|libbeamng.lua.V.ResearchVE|Trying to connect to: localhost:64257 045.843|I|libbeamng.lua.V.ResearchVE|Connected! 045.847|I|GELua.util_researchGE.ResearchGE|Setting engine flags! 045.879|D|GELua.scenario_scenarios.scenarios|changeState: running 045.880|D|GELua.core_camera.|Camera switched to "orbit" 045.940|E|GELua.core_levels.levels|info.json missing: /levels/garage/info.json 045.942|E|GELua.core_levels.levels|No entry point for level found: /levels/garage. Ignoring level. 045.944|E|GELua.core_levels.levels|info.json missing: /levels/smallgrid/info.json 045.947|E|GELua.core_levels.levels|No entry point for level found: /levels/smallgrid. Ignoring level. 045.974|E|GELua.ResearchCom|Error reading from socket: closed 045.981|E|libbeamng.lua.V.ResearchCom|Error reading from socket: closed 048.730|I|libbeamng.lua.V.ResearchVE|Trying to connect to: localhost:64257 052.758|I|libbeamng.lua.V.ResearchVE|Could not connect...

------------------ 原始邮件 ------------------ 发件人: "FitashUlHaq"notifications@github.com; 发送时间: 2019年10月22日(星期二) 晚上7:15 收件人: "BeamNG/BeamNGpy"BeamNGpy@noreply.github.com; 抄送: "王森"1325412401@qq.com; "Comment"comment@noreply.github.com; 主题: Re: [BeamNG/BeamNGpy] BeamNG.research Connection problem (#28)

In my case it connects for the first time and then cannot connect

029.612|I|libbeamng.lua.V.ResearchVE|Trying to connect to: localhost:64257 031.627|I|libbeamng.lua.V.ResearchVE|Connected! 031.630|I|GELua.util_researchGE.ResearchGE|Setting engine flags! 031.662|D|GELua.scenario_scenarios.scenarios|changeState: running 031.663|D|GELua.core_camera.|Camera switched to "orbit" 031.712|E|GELua.core_levels.levels|info.json missing: /levels/garage/info.json 031.713|E|GELua.core_levels.levels|No entry point for level found: /levels/garage. Ignoring level. 031.714|E|GELua.core_levels.levels|info.json missing: /levels/GridMap/info.json 031.715|E|GELua.core_levels.levels|No entry point for level found: /levels/GridMap. Ignoring level. 031.819|E|GELua.ResearchCom|Error reading from socket: closed 031.874|E|libbeamng.lua.V.ResearchCom|Error reading from socket: closed

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

FitashUlHaq commented 5 years ago

I tried 1- turning off firewalls 2- running it as administrator 3- freeing all ports None of above worked

FitashUlHaq commented 5 years ago

Hi @oooooverflow and @autonomobil, I solved the problem using the windows powershell. it does not work if you run it from cmd.

If you write the commands on powershell it works perfectly fine!

vladimirwest commented 4 years ago

The game is running perfectly when python script is executing. So simplest solution that worked for me is add time.sleep(99999) to the end of the main python script.

manojhuilgol commented 4 years ago

@vladimirwest Can you please describe where exactly did you add time.sleep() ? I tried adding it inside def main() function, but still it is not working.