User avatar
Doctorwho8
Posts: 56
Joined: Mon Dec 31, 2012 11:00 pm
Location: Astoria NY
Contact: Website

Node.JS Internet of Things server

Sat Jul 19, 2014 3:28 am

Hello!
Sometime ago Sparkfun released an Internet of Things based on the Node.JS server. It can be accessed from their site, which is located at https://data.sparkfun.com/ or the code can be added to the server provided a later version is downloaded and installed. The released version on the repository's stores is in fact too old.

And they want people to aim their Raspberry Pi devices at it, also run the code locally. I am also a supporter of the Parallax Propeller device and that's not on their lists.

What the company, (Parallax) does sell is a gizmo who has on it an Ethernet connection and it goes on their Quick Start device. And what I'd like to do is like this, connect the gizmo to a USB attached Ethernet device and have the running server pick up the data from it.

Problem here is that I'm not sure how to configure the necessary DHCPD service for delivering an IP address to this Ethernet device and thence to the Parallax device. Writing the code for the Parallax device is off-topic here, and being addressed elsewhere, but I will report on that next time.

Here's the thing, this Raspberry Pi has its onboard Ethernet port connected to my local network, which is appropriate as the board runs headless. So in this case the Ethernet device which is plugged into USB0 would need to be assigned eth1 by the DHCPD services.
-------------------
Gregg
Doctor Who8

User avatar
joan
Posts: 14274
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Node.JS Internet of Things server

Sat Jul 19, 2014 8:00 am

Do I understand correctly, you want to assign an IP address to a device connected via a USB Ethernet dongle?

eth1 is the name of an interface, not an IP address.

Have you looked at dnsmasq? That is a DHCP server which is reasonably simple to configure and will run on the Pi.

User avatar
Doctorwho8
Posts: 56
Joined: Mon Dec 31, 2012 11:00 pm
Location: Astoria NY
Contact: Website

Re: Node.JS Internet of Things server

Sat Jul 19, 2014 2:11 pm

Hello!
Basically yes. And point of fact, the interface name I've given is in fact how the device will be "seen" by the Pi. I've looked at that one before. Its too complicated for what I've got in mind. (Or it might be.)
-------------------
Gregg
Doctor Who8

User avatar
joan
Posts: 14274
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Node.JS Internet of Things server

Sat Jul 19, 2014 2:16 pm

Doctorwho8 wrote:Hello!
Basically yes. And point of fact, the interface name I've given is in fact how the device will be "seen" by the Pi. I've looked at that one before. Its too complicated for what I've got in mind. (Or it might be.)
I'm not aware of a simpler way.

User avatar
DougieLawson
Posts: 36179
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Node.JS Internet of Things server

Sat Jul 19, 2014 2:18 pm

sudo ifconfig eth1 192.168.3.14 netmask 255.255.255.0
sudo ifconfig eth1 up

You can also code for it in /etc/network/interfaces

Code: Select all

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet dhcp
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
joan
Posts: 14274
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Node.JS Internet of Things server

Sat Jul 19, 2014 2:33 pm

DougieLawson wrote:sudo ifconfig eth1 192.168.3.14 netmask 255.255.255.0
sudo ifconfig eth1 up

You can also code for it in /etc/network/interfaces

Code: Select all

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet dhcp
But
... for delivering an IP address to this Ethernet device and thence to the Parallax device ...

User avatar
DougieLawson
Posts: 36179
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Node.JS Internet of Things server

Sat Jul 19, 2014 2:42 pm

joan wrote: But
... for delivering an IP address to this Ethernet device and thence to the Parallax device ...
The interface on the RPi will need a static IP address. If it's going to "deliver" IP addresses to connected equipment it needs to run a dhcp server (or route dhcpdiscover packets to a connected dhcp server).

I think we need the OP to draw a diagram of what's connected to what on his network.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Networking and servers”