matth-x / MicroOcppSimulator

GNU General Public License v3.0
91 stars 38 forks source link

Unable to fetch connectors #5

Open quanyshh opened 1 year ago

quanyshh commented 1 year ago

изображение Hello, an error comes out "Unable to fetch connectors". Are there any instructions on the simulator?

agruenb commented 1 year ago

This means most probably that the request timed out. Are you sure that the simulator is still running? Try visiting http://localhost:8000/api/connectors in your browser while the simulator is running. If the api is reachable it should display something like: ["1","2"]

aviarybuilds commented 10 months ago

the website forces all api calls to localhost. Is there a way to use the computer's IP address instead? i'm trying to run this in a headless VM, and would love to be able to access the web portal through the intranet connection instead of using the browser on the desktop of the PC itself simulator

matth-x commented 9 months ago

@aviarybuilds The relevant spot in the sources is the nodejs environment manifest (e.g. .env.development). A short documentation of the API root definition is in the API configuration section.

As a general background, the Simulator comes with a compiled version of the dashboard. If you want to change the dashboard (e.g. the API root), then you need to edit the dashboard sources and rebuild it, so that the Simulator can use the new compiled version. A brief overview of the build process is given in this section of the README. Furthermore, the whole README of the dashboard repo is very relevant.

If you encounter any problems, please update this issue with your findings. I only tested the Simulator on the local host so far, but would be very interested in arbitrary base URLs support.

eiwin commented 9 months ago

I had the same issue with a headless VM. Then I did this and it works for me. Copy .env.development to .env.production, and then change localhost to your ip adress. Copied the compiled and compressed file according to the description. Then I can access the webpage using ip adress. Thanks @matth-x for the beautiful work.

the website forces all api calls to localhost. Is there a way to use the computer's IP address instead? i'm trying to run this in a headless VM, and would love to be able to access the web portal through the intranet connection instead of using the browser on the desktop of the PC itself simulator

GanesanGuru commented 9 months ago

Hi @matth-x @eiwin , I've tried the same by editing the .env.production file, yet unable to compile. I'm getting error @ npm build part. The log is attached as follows. Kindly do let me know, what am I missing!! ocpp_log.txt

Gazdella commented 4 months ago

Hello @matth-x , I edited .env.development file with my ip but I cant find .env.production . I still got same issue "Unable to fetch connectors". Could you please help me?

agruenb commented 4 months ago

Hello @matth-x , I edited .env.development file with my ip but I cant find .env.production . I still got same issue "Unable to fetch connectors". Could you please help me?

There is no .env.production file in the repository. You have to manually create it and then copy the contents of the .env.development file into it. After that you can alter the variables to your liking and build the bundle.

There is a short walk-through of the process in the readme.

Gazdella commented 4 months ago

I created it but still got same error Screenshot 2024-06-14 at 3 35 20 PM

agruenb commented 4 months ago

Could you please add some more information about the error? Have you opened the browser network tool and checked that the correct address is used? Did you rebuild the webapp manually or did you use the script?