danslimmon / oscar

Scan your coffee's barcode, and it'll get added to your grocery list
MIT License
263 stars 46 forks source link

Local IP sent in text: cant Teach Oscar. #30

Closed olujoe closed 9 years ago

olujoe commented 10 years ago

Can we edit the learning on Trello instead

I have a variable ip router at home so when I shut it down and restart it I always get a new ip, further more the pi is on a floating 192.168...... ip so when I get a text its no use and I cant help oscar learn, this is what I get in my text.

Hi! Oscar here. You scanned a code I didn't recognize. Care to fill me in? http://192.168.1.5/learn-barcode/qsigTIKY7rRS

olujoe commented 10 years ago

I tried opening the link from the pi, but no joy, maybe I need a server running on the pi, but will Oscar know to forward the ip and port? Help please? Ps oscar rocks.

CloCkWeRX commented 10 years ago

maybe I need a server running on the pi

Do

tail -f /var/log/supervisor/oscar_web.log

And you should see

debugger listening on port 5858
Express server listening on port 80

Try following the link and see what comes up.

On my local, I do it with the same link as you provided and see

undefined:2
\'> <p>What grocery item should I add for the barcode '+(it.opp_data.barcode)+
                                                                    ^
TypeError: Cannot read property 'barcode' of undefined
    at Object.eval (eval at <anonymous> (/var/oscar/web/node_modules/dot/doT.js:125:11), <anonymous>:2:154)
    at /var/oscar/web/node_modules/express-dot/express-dot.js:23:30
    at fs.js:266:14
    at Object.oncomplete (fs.js:107:15)
debugger listening on port 5858

... but that's because nothing is in my trello db

CloCkWeRX commented 10 years ago

Oh, and for the moving IP addresses; when you are at home; follow http://www.howtogeek.com/167190/how-and-why-to-assign-the-.local-domain-to-your-raspberry-pi/

That'll let you access your pi by raspberrypi.local (on your local network only though)

olujoe commented 10 years ago

When i entered "tail -f /var/log/supervisor/oscar_web.log"

this is what i get back:

module.js:340 throw err; ^ Error: Cannot find module 'js-yaml' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/var/oscar/web/lib/conf.js:1:74) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) debugger listening on port 5858

olujoe commented 10 years ago

still unable to see the link: Cannot resolve hostname (xxxxxxx.local)

im going to try a web server like lighttpd

....still no change seems having a server does not help. can anyone help with getting oscar to send my router ip instead of the local ip?

olujoe commented 10 years ago

Guys, im still stuck on this one, please Help!!!

BluGeni commented 10 years ago

navigate to where your node modules folder is: cd /var/oscar/web/node_modules (this might be different depending on where you install it to)

then install js-yaml sudo npm install js-yaml

you will probably also need to install express-dot sudo npm install express-dot

if you have apache2 running you will need to stop that service or remove it.

should be good to go now, reboot for good measure and check your error log: tail -f /var/log/supervisor/oscar_web.log

CloCkWeRX commented 9 years ago

The js-yaml problem is fixed in master, and the variable IP issue is as per the .local address solution

Kimsipi commented 9 years ago

I have the same issue and I have done all the above , what are we using as webserver?