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

Map-Chat / Crowd Sourced Data #4596

Merged
merged 14 commits into from
Aug 23, 2016
Merged

Map-Chat / Crowd Sourced Data #4596

merged 14 commits into from
Aug 23, 2016

Conversation

BreezeRo
Copy link
Contributor

@BreezeRo BreezeRo commented Aug 23, 2016

This goes back to PR #3400 wish should of been discussed a bit more as I don't think people realized the scope at which @solderzzc was talking of going with this is huge. Here is a working example (with his previous PR + help of course) of a crowd sourced map.

Basically the idea is to use a relay system (mqtt here) to recieve messages from the client (containing pokemon spawn coordinates in this example). Each client subscribes to the topic (in this case "chat" and pokemon coordinates), and this information is relayed across the network of all bots.

Think "torrent". In this way the bots are effectively able to communicate with eachother, and as demonstrated in our example, plot the pokemon spawns on a map using data gathered from all bots that are broadcasting. The source of the coordinates is stripped away from the message, so no one knows where it came from.

As it stands now we are using a test mqtt broker, which is perfect considering we are in development branch. The idea is that the community will host or create their own mqtt brokers (relay points or "hubs"), and transmit the data to those brokers and receive them the same way as in this example. This will allow us to display all kinds of information on the map such as pokemon spawn locations, high ban count zones, lured forts, ect.

In this working example the bot client transmits coordinates of catchable pokemon to the relay server, strips identifying data, and these coordinates are then readable by all other bot clients to work with.

image

To view the map and chat/communicate

NOTE: This requires port 1883 active

cd map-chat
python -m SimpleHTTPServer 8080

And open 127.0.0.1:8080 in your browser. To disable the feature as it's presented here, change "enable_social" in config

@BreezeRo BreezeRo merged commit 4836de0 into dev Aug 23, 2016
# 2 matches, this must be a coordinate. We'll bypass the Google
# geocode so we keep the exact location.
self.logger.info(
'[x] Coordinates found in passed in location, '
'not geocoding.'
)
return float(possible_coordinates[0]), float(possible_coordinates[1]), (float(possible_coordinates[2]) if len(possible_coordinates) == 3 else self.alt)
return float(possible_coordinates[0]), float(possible_coordinates[1]), self.alt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BreezeRo Could you change line 1063 and 1070 back? This was merged in PR #4581.

@BreezeRo
Copy link
Contributor Author

@alexyaoyang restored, sorry about that, branches were minutes apart

@solderzzc solderzzc deleted the ro-map branch August 23, 2016 03:23
@alexyaoyang
Copy link
Contributor

@BreezeRo All is good 👍

@MasterCATZ
Copy link

perfect , exactly what I have been waiting for , shared scanner data

now all that will be needed is an verification system so if multiple bots are is getting false spawns it can be removed from the swarm ? ( ie someone falsifying data )

@BreezeRo
Copy link
Contributor Author

BreezeRo commented Aug 23, 2016

@MasterCATZ absolutely, through use of the encounter_id + coordinates we can somewhat verify if the coordinate is legit, next step is to perhaps ensure that the long/lat is actually valid and not in the ocean before allowing it to be read. I'm sure some guys around here got some good ideas to input on this. Very good point you bring up.

I want everyone to keep in mind that in "crowd sourced" anything you run the chance of having someone in the crrowd running faulty info, but these guys should never outnumber legit source ;)

@Tych0n
Copy link

Tych0n commented Aug 23, 2016

@BreezeRo could you please reduce logging, cause people will turn off this feature and we will loose part of data, collected from enabled-by-default config #4602

@TheCannings
Copy link
Contributor

I'm getting an error of:

Oops! Something went wrong.
This page didn't load Google Maps correctly. See the JavaScript console for technical details.

I check the console and see:

Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys

Is this working off the google maps api key in the config.json or should we be specifying this elsewhere?

@hobbes3
Copy link

hobbes3 commented Aug 23, 2016

Same as @TheCannings. Where do I put the Google Maps key?

@newjanson
Copy link
Contributor

yap ^

@danielsdian
Copy link
Contributor

When this goes live, we need to modify the PokemonGo-Bot-Start batch to start this webserver too. Right now, it only starts the bot and the PokemonGo-Bot Map.

@BreezeRo
Copy link
Contributor Author

The key message is only a warning and can usually be ignored, let me see if I can reproduce it

@danielsdian
Copy link
Contributor

FYI, the chat option doesnt work on Microsoft Edge. Maybe should add a warning about it. you can see the map and the dots, but the text boxes doesnt pop up.

@danielsdian
Copy link
Contributor

Also, on Chrome all the messages are popping up as "undefined".

@BreezeRo
Copy link
Contributor Author

BreezeRo commented Aug 23, 2016

thats normal Daniels, please read the original OP, this is a work in progress ;)

EDIT: Testing on different OS + browsers now, will get back to you here very soon

@danielsdian
Copy link
Contributor

I know, just providing some feedback.

@daemonsyn
Copy link

Anyone with this error?

self.mqttc.publish("pgomapgeo/"+geo_hash+"/"+str(data['pokemon_id']), str(data['latitude'])+","+str(data['longitude'])+","+str(data['encounter_id'])+","+str(data['pokemon_id'])+","+str(data['expiration_timestamp_ms'])+","+str(data['pokemon_name'])) KeyError: 'pokemon_name'

@bruvv
Copy link
Contributor

bruvv commented Aug 28, 2016

when creating something like this don't forget to update the readme and the other docs..

@MZorzy
Copy link

MZorzy commented Sep 1, 2016

can this be used for snip pokemon ? without run a local map scanner, read other bot account same ip no good)

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

Successfully merging this pull request may close these issues.