Code Monkey home page Code Monkey logo

Comments (20)

toddtreece avatar toddtreece commented on August 23, 2024

It looks like you might have some other web server running on the default port (8080)

from phant.

tryceattack avatar tryceattack commented on August 23, 2024

any way i could stop start the other processes, if its a good idea at all?

from phant.

toddtreece avatar toddtreece commented on August 23, 2024

I'm not really a Windows user, but this might help you tell what's running: http://stackoverflow.com/a/105448

from phant.

tryceattack avatar tryceattack commented on August 23, 2024

oh ok thanks. so turns out port 8081 is being used. is there a way i can tell phant to not use 8081 and use some other number? and what number would i use if that matters?

from phant.

toddtreece avatar toddtreece commented on August 23, 2024

yep. try running npm update -g phant to get the latest version of phant (it should be at least v6.0.4).

once you have upgraded, you can make a config file called .env in your favorite plain text editor and add PHANT_TELNET_PORT=8082 to the file. change 8082 to whatever port you would like it to run on. it doesn't really matter where you put the file, just as long as you remember where you put it.

this gist will show you how the file should look.

then you can run phant from the same directory as the .env file, and it should load the config from that file. i'll be writing docs about the stuff you can change with the .env file soon, but that should get you running.

from phant.

tryceattack avatar tryceattack commented on August 23, 2024

ok i did that but, now it is saying they are both running on port 8080. i tried changing both numbers , like phant_port to 8079, keeping it at 8080, phant_telnet_port to 8082 or 8083, and it would still say both are using port 8080.

once i remove the .env file it goes back to 8080 and 8081.

from phant.

toddtreece avatar toddtreece commented on August 23, 2024

it sounds like you have an old version of phant installed. what's the output of npm list -g phant

from phant.

tryceattack avatar tryceattack commented on August 23, 2024

[email protected]

from phant.

toddtreece avatar toddtreece commented on August 23, 2024

yep. you'll need to run npm update -g phant to get the latest version (currently 6.1.4). there was a bug in the .env port numbers in that version.

from phant.

tryceattack avatar tryceattack commented on August 23, 2024

sweet it's running. So now i'm following the rest of the README, i opened a new command prompt, ran as administrator, and i typed telnet localhost 8082, and it is telling me telnet is not recognized as an internal and external command

edit: nvm just did a quick google search and found my answer. wasn't a problem with the package

from phant.

toddtreece avatar toddtreece commented on August 23, 2024

Great! Those example commands are for a linux/unix environment, and I should probably mark them as such. Windows doesn't have a telnet client enabled by default, so you'll have to download something like PuTTY and use it as a telnet client.

from phant.

tryceattack avatar tryceattack commented on August 23, 2024

Right on! So I managed to get to the phant terminal, and i was able to create a stream with the create command. But it seems like I can't access the url with my public key. I'm probably wrong in what I'm doing, but what i did was take the url https://data.sparkfun.com/streams/ and then append the public key. I think i should be using something with my ip address and telnet port number. Or perhaps I need to do something in ruby, perl or some php?

from phant.

toddtreece avatar toddtreece commented on August 23, 2024

Running phant from your local machine will allow you to post data and save it locally. The basic server you just install uses telnet to manage streams (create & delete) instead of the web UI that you see on data.sparkfun.com.

In these two examples I'm going to use 8080 as your HTTP port, but you should use whatever port you set using the PHANT_PORT variable in the .env file. Replace PUBLIC and PRIVATE with your keys, and FIELD and VALUE with your field name and the value you'd like to log. You can add as many fields as you'd like by adding more parameters to the query string. Here's more info about how to add data to your server: http://phant.io/docs/input/http/

To post data to your local machine:

http://localhost:8080/input/PUBLIC?private_key=PRIVATE&FIELD=VALUE

To get that data back:

http://localhost:8080/output/PUBLIC.csv

from phant.

tryceattack avatar tryceattack commented on August 23, 2024

hmm i tried to connect to the localhost with just http://localhost:8082, as well as the full input of keys, and i seem to be getting nothing back, it's still in the "waiting for localhost" stage.

from phant.

toddtreece avatar toddtreece commented on August 23, 2024

can you paste your .env file here?

from phant.

tryceattack avatar tryceattack commented on August 23, 2024

sure

PHANT_PORT=8080
PHANT_TELNET_PORT=8082

from phant.

toddtreece avatar toddtreece commented on August 23, 2024

So you'd use http://localhost:8080/input/ to post data. PHANT_PORT defines what port the HTTP server runs on. PHANT_TELNET_PORT defines what port the telnet server runs on.

from phant.

tryceattack avatar tryceattack commented on August 23, 2024

it works now!!! thank you for all help!

from phant.

toddtreece avatar toddtreece commented on August 23, 2024

Thanks for the feedback. I'll use our discussion to write up a small tutorial about starting the server on Windows. Sorry it was such a pain!

from phant.

tryceattack avatar tryceattack commented on August 23, 2024

Twas no pain with your punctual response! Good learning experience for me, not having much experience with connections

from phant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.