Skip to content
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

stuck at network setting when adding hotspot via maker app #34

Open
tuannt1531 opened this issue Apr 6, 2022 · 6 comments
Open

stuck at network setting when adding hotspot via maker app #34

tuannt1531 opened this issue Apr 6, 2022 · 6 comments

Comments

@tuannt1531
Copy link

Hi Teams,
I am trying to build and use the maker app, when I try to add the hotspot feature, I can scan the hotspot and connect via BLE, but go to the network setting step, I can't scan wifi instead or choose to use ethernet or any whatever else it seems to be stuck here, while I can still add hotspot using helium app.
Do you have any suggestions for this?. Does the maker app fully support adding the hotspot feature?

Thanks!
image
image

@tyler-whitman
Copy link
Collaborator

Hello, did you set up deep linking to integrate your maker app with the helium app? We have sdks to help with this process, which have been integrated into the maker starter app. These are the high level steps needed to add a hotspot to the network using a maker app.

  • maker app provides the owner and payers keys to the miner to create the add gateway transaction
  • miner creates the initial transaction, signs it with the gateway key, and sends base64 back to the maker app
  • maker app deep links the hotspot app to gets a wallet link token
  • hotspot app signs the txn with the owner key and sends back update base64 via callback
  • maker app submits that to the onboarding server
  • onboarding server signs with the payer key, and sends back to the maker app
  • maker app submits the signed txn to the blockchain

You can find documentation on Wallet Link (deep linking) here: https://helium.github.io/react-native-helium/modules/WalletLink.html
You can find documentation on the maker process here: https://docs.helium.com/mine-hnt/full-hotspots/become-a-maker/hotspot-integration-testing

@tuannt1531
Copy link
Author

thanks for your reply!

  • yes, I have created deep linking with helium app to successfully login on maker app.
  • my hotspot added successfully following the instructions from "hotspot integration testing" with helium app. However when adding with maker app, I can't get through the network setting screen,
  • I have enabled debug mode and get error log when calling API "GET https://api.helium.io/v1/hotspots/11jt9VgoHQDHrU85NvbLwK2461YhwxVhh5oxnqYGkUJDFcH5cLV [404] ]"
  • here is the error log: "5:09:10 PM | ERROR : Error: {"message":"Request failed with status code 404","name":"Error","stack":"@/private/ var /containers/Bundle/Application/DB21E44C-B982-421E-ABBE-48F89FD1517F/OpreyElectronicsHotspot.app/main.jsbundle:980:87\n@/private/var/con..."

  • you can see the log via this link: https://sentry.io/share/issue/0e5bb70e981a44e5af1ed38390183739/

  • at this line of code "const hotspot = await getHotspotDetails(hotspotAddress) "

@tyler-whitman
Copy link
Collaborator

Thanks for more detail, the 404 error when checking the hotspot is expected as it has not been added to the blockchain yet. We just got another report of the same bug. It looks like in HotspotSetupWifiConnectingScreen.tsx the setWifi call is failing with the following error "Unknown Error" when providing the correct wifi password. Could your confirm if this is the same case for you?

@tuannt1531
Copy link
Author

Thanks for your reply!
I don't scan wifi, I choose "Use Ethernet Instead" and it's stuck here, it doesn't pass to the HotspotSetupLocationInfoScreen screen.

  • according to this source code:
    const navSkip = useCallback(async() => {
    const token = await getSecureItem('walletLinkToken')
    if (!token) return
    const address = await getAddress()
    const hotspot = await getHotspotDetails(hotspotAddress)

    if (hotspot && hotspot.owner === address) {
    navigation.replace('OwnedHotspotErrorScreen')
    } else if (hotspot && hotspot.owner !== address) {
    navigation.replace('NotHotspotOwnerErrorScreen')
    } else {
    navigation.replace('HotspotSetupLocationInfoScreen', {
    hotspotAddress,
    addGatewayTxn,
    hotspotType,
    })
    }
    }, [addGatewayTxn, hotspotAddress, navigation, hotspotType])

after calling getHotspotDetails API, if hotspot is not added it will have to navigate to "HotspotSetupLocationInfoScreen" screen, right?

@tuannt1531
Copy link
Author

Thanks for more detail, the 404 error when checking the hotspot is expected as it has not been added to the blockchain yet. We just got another report of the same bug. It looks like in HotspotSetupWifiConnectingScreen.tsx the setWifi call is failing with the following error "Unknown Error" when providing the correct wifi password. Could your confirm if this is the same case for you?

I have a question:

  • if line of code "const hotspot = await getHotspotDetails(hotspotAddress)" return 404, it will throw an exception and can't reach the "HotspotSetupLocationInfoScreen" screen, right?
  • can you confirm that a new hotspot which has never been added to the helium blockchain when calling this API will return a 404?
    Thanks!

@tyler-whitman
Copy link
Collaborator

tyler-whitman commented Apr 12, 2022

Yes, a 404 is expected and await getHotspotDetails(hotspotAddress) will return undefined causing the app to navigate to the HotspotSetupLocationInfoScreen. This check is there to make sure you are not adding a hotspot which has already been added to the blockchain.

You are getting stuck at this point? Since there is no try/catch around the await getHotspotDetails(hotspotAddress) the error will be ignored. You can put a try catch around it and log what error you get (should be a 404). Also, you can log the value you get from await getHotspotDetails(hotspotAddress) that would be helpful in debugging.

What happens when you click the use ethernet button? The app is just stuck and doesn't proceed?

You should be looking at HotspotSetupPickWifiScreen.tsx line 100 is where the code should navigate to the next step. I have a feeling maybe your wallet link token is missing and that is why you dont proceed? You can see that check on line 91

selvakn pushed a commit to clodpi/maker-starter-app that referenced this issue Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants