-
Notifications
You must be signed in to change notification settings - Fork 63
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
user name and password with wirehome cloud #15
Comments
If you deployed the cloud service you should login with "https://XYZ.azurewebsites.net/Cloud/Account/Login". After login you can also open links to the App etc. Please make sure you have the proper files in place with user accounts. |
Thanks ,i just launch the wirehome cloud in vs 2017 ,i can see the login page but doesnt have acount and password |
You need to create the accounts in the file system. Please have a look at class RepositoryService. There you find the root path and the object IdentityConfiguration which is deserialized from a JSON file. Those files contain the user and password hashes. |
i just launch the Wirehome.Cloud in vs 2017 , but i don't know what content should be added to it. and the hashes should not easy to do by hand , can you give a sampe And is it possible to provide way i can register user acount and password ? |
There are no files (accounts) by default. You need to create initial users via creating the proper files. I will add an API for this soon. But at the moment this is the only way. Here is an example of such a file:
The password is hashed. The hash above is for the password "123456" (without the "). You can login using that default password and change it via the API (please check Swagger UI for the cloud API). |
Thank you for your quickly reply, i can login now by the default password. |
The problem is that I don't have much time left to update/extend the wiki. So you questions are all fine and reasonable. After setting up the cloud account you need to update the cloud settings at the Wirehome.Core in the file CloudServiceConfiguration.json. The password there is not encrypted and plain text. The IdentityUid is the e-mail address you used. And you need to set the proper host according to your hosting strategy. After restarting Wirehome.Core you should see some messages in the log indicating whether the connection is up and running or failed. |
@chkr1011 Long time passed, i'm back again. now i can login, and there is log info in the terminal shows login OK but device not connected. what i need to do next ? if i need creat a mqtt client to connect to this server ? Or could you please give a short guide i can follow to do , thank i'm run Wirehome.Cloud in windows 10 with vs2017. --------------------Config ------------------------------- ------------------------LOG ---------------------------------------------- Wirehome.Cloud> info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1] |
Please check the device status using the cloud API (.../cloud/api/index.html). There you have the API " No you don't need a MQTT client. If the connection is established and your credentials are correct the cloud acts as a proxy for EVERY URL and forwards that you your device. So http://127.0.0.1:54128/app/ will be forwarded to your Pi, then invoke /app/ and returns the result. You can access ANY other web app like /api/, /configurator/ etc. But first please let me know if your connection is shown in the statistics API. |
I'd like to decsribe what i have done so far: 1、i commit out history service in Startup file of WireHome.Core 2、runing the irehome.Core.Hosts.Console, 4、nivagate to http://localhost:54128/api/v1/cloud/statistics。 i can see : Then , while the console startup ,i see these error , i also change the CloudServiceConfig.json to : "host": "localhost:54128", the error still has " Error while connecting with Wirehome.Cloud service at host 'localhost:54128'." |
Hi Christian, {"connectedDevicesCount":0,"connectedDevices":[]} and The cloudservcieconfiguration,json is: { |
Hi, But I also added some more debug information so that we can find the issue easily. So please use the latest master branch for testing. But I already saw that you use port 5001 at the cloud service but configured "localhost:54128" in Wirehome.Core. This cannot work at all because ports must be the same. Let me know as soon as you have the latest master branch running. I will also add some sample configuration files to the repo. |
Hi Christian, By the way, because 80 port was occupied,so i changed the port from 80 to 8088 in the following files: Now, i modified host address to localhost:5001 in the CloudServiceConfiguration.json file, the problem still there : {"connectedDevicesCount":0,"connectedDevices":[]} I did a further debug , i "Found" if Wirehome.Cloud wants to has connected channel , there should have a websokcet client connection from wirehome.core.Hosts.console via "https://localhost:5001/Connector", and then Wirehome.Cloud call "deviceConnectorService.RunAsync", then assgin channel to " _openChannels[channelIdentifier] = openChannel;", is this right ? And i also found there is no such call from wirehome.core.Hosts.console , when the CloudService Started , because the "_options.ChannelAccessToken" is NULL , so it jump to next cycle runing in ConnectAsync task. Please check: Task.Run(() => ConnectAsync(cancellationTokenSource.Token),cancellationTokenSource.Token).Forget(_logger);
} |
Hi Christian, Then, in VS2019, i launch the Cloud project with selction is IIS Express( if selection is Wirehome.Cloud itself, it can't get websocket call from websocket client ), then Wirehome.Cloud can get call , but there is an exception: Is it caused by wrong token ? Thanks. @chkr1011 |
OK, let me summarize some things.
|
Hi Christian, Thanks for your patient guidance, now Wirehome.core can properly connect to Cloud BUT when i click App and Confugurator link, both are show blank screen with 404 info in ternimal(see below info), but APIdefinition link works fine, i can see swagger pages,and there are many apis,such as mqtt .... And i can see device is connected info via statistics API: {"connectedDevicesCount":1,"connectedDevices":[{"identityUid":"[email protected]","channelUid":"[email protected]"}]} ////// Currently i use config same as repo except two changes: 2、 changing Host Now the two configure content like this: So , now the problem changes form"Device not connect " to "blank screen", @chkr1011 ☹ In Swagger, App module has follow apis. In Cloud , i can see AppController only support router: api/v1/app/access_type Dose it matter ? |
That is a step forward 😄 For me it works perfectly. Why do you need the use identity etc? These are no longer used in code so they can be removed from the service configuration (not entity). Where is ""Logger":"info"" coming from? Did you add something on your own? Please make sure that you are using the latest master branch. The app service and controller is OK so far. Only one API is "overridden". But let me explain this after the other stuff works 😄 Do you have the app package installed? I mean can you open the app (.../app/) when not using the cloud connection? |
OK, i use the same config as repo, it works fine except "blank page" problem. I can't open the app with or without cloud connection. I havne't installed app yet 😟 I read the questions https://github.com/chkr1011/Wirehome.Core/issues/2, but swagger page doesn't have "Repository" area. Also, wiki said i need put Wirehome.App to the directory WebApp in the bin directory, i can't find which patch WebApp locates , I use visual studio debug mode under window10 system. Hope for more information 😊 |
OK that is perfect. So it seems to work now. When you can see the swagger definition it works perfectly. The cloud is just an addon. So we still have to setup the "big" things like components and component groups. You can prepare the app etc. by executing the setup API from the system API group (directly from swagger). It will automatically download the latest APP version from GitHub to your installation. The Wiki is a little bit outdated. So please try to ignore this for now 😄 After this is done you can try to open http://whatever/app/ using the address from your pi or localhost. I should open the app. After that you can also try to open the app by using the cloud service. The uri remains the same. |
@chkr1011 👍👍👍 |
Ah that is perfect. Now you have to add components and component groups etc. Do you have some hardware? Then I can support you in creating these files. |
Yes , I have a Pi 4B here, and Led 、Buzzer module and a modbus module can connect to it |
Ah OK. You can try to prepare everything then I can tell you how to configure it in wirehome. |
after launching the web ,how to log in
The text was updated successfully, but these errors were encountered: