Shop OBEX P1 Docs P2 Docs Learn Events
Spinneret Sdcard as a network Drive — Parallax Forums

Spinneret Sdcard as a network Drive

oodesoodes Posts: 131
edited 2013-10-26 01:29 in Accessories
Do anyone know is possible or have done any work on using the spinneret as a network drive. Basically I have my Spinneret on my network and I want to access logfiles that will be on the sd card across the network.I have a spinneret that communicates with 2 devices(soon to be more :D) that use Propellor chips , I want my devices to send their logfiles to the Spinneret store them on the SD card and then access the files on the sd card over my network. I looked at Mikes demo HTTP server where I can open up the htm files so I'm assuming its possible :D .
Anyone done anything similar to this?

Regards

Des

Comments

  • Mike GMike G Posts: 2,702
    edited 2013-10-21 03:38
    Basically I have my Spinneret on my network and I want to access logfiles that will be on the sd card across the network.I have a spinneret that communicates with 2 devices(soon to be more ) that use Propellor chips , I want my devices to send their logfiles to the Spinneret store them on the SD card and then access the files on the sd card over my network.
    Sure, HTTP POST is one way to submit a file to the Spinneret. msrobots wired up examples as well.

    If the goal is to behave like a network drive where you type in a UNC path, well that's going to be a little tougher - but doable. Off the top of my head, you'll need to register the Spinneret on the network DNS or NetBEUI (Windows). The next step is to study and implement the protocol.

    IMO, if you need DNS or NetBEUI that means you're on a network already. Why not just send the file to a PC on the network? That would be much easier to implement.
    I want my devices to send their logfiles to the Spinneret store them on the SD card
    How does this work? How are these devices connected to the Spinneret?
  • oodesoodes Posts: 131
    edited 2013-10-21 04:17
    Mike G wrote: »
    Sure, HTTP POST is one way to submit a file to the Spinneret. msrobots wired up examples as well.

    The next step is to study and implement the protocol.
    Which protocol is that?
    At the minute I have the Spinneret connected to a Hub which communicate to my Propeller Devices via Ethernet (You may remember my previous posts in relation to this :D). At the minutes I just have them handshaking and sending small amounts of Data between each other but the principle is working.
    Mike G wrote: »
    Why not just send the file to a PC on the network? That would be much easier to implement.

    How might you purpose to do this?

    I am looking at using a Beaglebone to replicate a PC in the future so I can analyse the logfiles over the web as this will be set up remotely. But for the time being I wanted to try set the spinneret as a network drive but it was just a thought , if there are easier solutions to this then I all for it. But the bones of what I trying to achieve are to have the spinneret communicating with several devices acting as a host collecting data and then been able to access this data collection from the Internet .

    What ya think :lol:

    Regards

    Des
  • Mike GMike G Posts: 2,702
    edited 2013-10-22 03:35
    Which protocol is that?
    A network drive requires a protocol like SMB SMB is only part of the picture. Name to IP resolution is also required; DNS, NetBEUI.
    How might you purpose to do this?
    This would take a much larger discussion but essentially send the data from the Spinneret to a PC. PC are already really good at being a network drive.
  • oodesoodes Posts: 131
    edited 2013-10-22 05:47
    Mike,

    I'm gonna work on getting my logfiles onto the sd card on the Spinneret and take it from there. I have sifting through the forums and came across a suggestion by yourself to use the GET POST to pull text files of the http server. I'm basically just looking for the easiest way to access the information that is stored on the spinneret sdcard. I'll be back when I have the logfiles sorted

    Kind Regards

    Des
  • Mike GMike G Posts: 2,702
    edited 2013-10-22 06:26
    If a network drive is not required, I'd create a simple SPIN method that builds a dynamic list of files in the log directory. Call the method when some URL or querystring is submitted to the Spinneret.
  • oodesoodes Posts: 131
    edited 2013-10-25 04:38
    Mike ,

    How's things?. Ok I have my logfiles transferring from my Prop Devices to the spinneret and its working nicely using the TCPSocketClient. The logfiles can get big so I'm chunking the data across and its working well with the Data on the SD card of the Spinneret mirroring the data on the sdcard of my Props.
    You mentioned:
    Call the method when some URL or querystring is submitted to the Spinneret.
    How would I implement this? Using the Http server is it? I'm looking to Upload the 2 logfiles files from the SD card to a server. The network drive idea can go on hold for the time being.
    One other question and excuse my ignorance but what is the function of the SDCard FatEngine Wrapper , why not just use the FATEngine on its own?

    Regards

    Des
  • oodesoodes Posts: 131
    edited 2013-10-25 05:42
    I'm looking at it from the wrong angle I think. I need just to keep the spinneret as a Client and upload the files to my network server. So at the minute I'm using the spinneret as a TCPClient to get the logfiles in a Linear fashion, ie. Get LOG1 from Prop1 and save LOG1 on SDcard of Spinneret, then Get LOG2 from Prop2 and save LOG2 on SDcard. Now I just need to access a folder on my Network using the Spinneret. How would I access a folder on the network using the spinneret? If i type "file://192.168.1.3/desmond" in my browser I can access the folders, how might I do this with the spinneret?

    Kind Regards

    Desmond
  • Mike GMike G Posts: 2,702
    edited 2013-10-25 05:57
    One other question and excuse my ignorance but what is the function of the SDCard FatEngine Wrapper , why not just use the FATEngine on its own?
    Wrapping an object moves configuration out of the top level object.
    If i type "file://192.168.1.3/desmond" in my browser I can access the folders, how might I do this with the spinneret?
    No, I did not write SPIN code to handle directory browsing.

    It's not too hard to do. Filter the client request for "desmond" in the URL. Look up all the file names in the "desmond" directory. Use the names to build a dynamic HTML web page. Finally, send the page to the client.
  • oodesoodes Posts: 131
    edited 2013-10-25 06:50
    Cheers Mike ,

    That gives me a few avenues to look into. Can I do all that with SPIN code? The folder is also password protected , will I be able to get around this with SPIN code?
    My boss reckons we should invite you to the Christmas party for all the help you give me :lol:
    Have a nice weekend

    Des
  • Mike GMike G Posts: 2,702
    edited 2013-10-25 09:57
    Can I do all that with SPIN code? The folder is also password protected , will I be able to get around this with SPIN code?
    Yes, nothing more than building a string in memory.
    The folder is also password protected , will I be able to get around this with SPIN code?
    You want to password protect the folder on the Spinneret? If so, there is an example, TcpSocketBasicAuthenticationServerDemo.spin, which uses the W5200. Basic authentication on the Spinneret would work the same.
  • oodesoodes Posts: 131
    edited 2013-10-25 12:59
    No the folder on my network is Password protected. I want to write the files on the SD card from the Spinneret to the network directory folder
  • Coder96Coder96 Posts: 42
    edited 2013-10-25 14:34
    I've been watching your guys thread today.

    Oodes:

    When you talk about writing to a network drive. I assume you are talking about a Microsoft windows box.

    If this is correct? To do this you will need to write the software that implements the The protocols that windows uses. This is not currently written for the spinneret. To put it lightly this is a monumental task. Both in hardware and software requirements.

    Here's a link to start you off
    Network Share Protocol

    If you really want to have an embedded device out in the field that can write to to a windows share. You are more than likely have to upgrade to a RaspberryPi, beagle-bone, or something of that nature.

    If you still want to stay with the spinneret.

    I would write software to have to windows server connect to the spinneret via HTTP protocol and retrieve the files.

    I understand this may not be optimal. I've had to do this type of thing may times for various reasons.
  • Mike GMike G Posts: 2,702
    edited 2013-10-25 15:46
    I want to write the files on the SD card from the Spinneret to the network directory folder
    As coder96 pointed out, it's easier implement a file copy/move using a PC/Server on the network. The PC/Server asks the Spinneret, Hey man - you have any files? The Spinneret response with a list of files name. The PC/Server downloads each file with a simple HTTP GET and saves the files in the network share.

    The Spinneret is a uController connected to the world via TCP/UPD. It's not a full blown networking thing-a-ma-jig, it has limitations... but the devise is very good at reporting uController stuff over a network. My advise, exploit the Spinneret's strengths and let better qualified systems handle the other stuff.
  • oodesoodes Posts: 131
    edited 2013-10-25 15:52
    To put it lightly this is a monumental task
    :lol: Me , programming and monumental tasks are not something that you will see in the same sentence(But I try to change this everyday :P)
    When you talk about writing to a network drive. I assume you are talking about a Microsoft windows box.
    Basically I have a network in the office and the server has all the files on it and my boss wants to see the Logs on it too . I'm linking a couple of devices that use Propellor chips(which talk to Industrial Printers) and build a small network with the Spinneret, which is now taking the Logfiles from the Propellor devices and I have them stored on the SD card on the Spinneret. Now I want to upload these files the server or access them over the web, to be honest it doesnt matter which method as long as I can access the data and the easier method is always good for me :tongue: This is just a bit of prototyping in the office , but this hopefully will end up in the field. I have ordered a Beagle bone which will hopefully handle the remote nature of the project when it goes into the field but I've never used it before but I'm glad you mentioned it. :thumb:

    I would write software to have to windows server connect to the spinneret via HTTP protocol and retrieve the files.
    What did you write this software with??

    I'm only accessing the Propellor devices every 24 hrs with the Spinneret to retrieve the logs. So I wondered would it possible to run the TCP client in one cog at the moment I need to retrieve the logs say midnight , this uses one socket and takes about 1 minutes tops. Then release the socket and run the spinneret as a HTTP server for the rest of the time and access the logs through via this? Do you think this is a viable option?

    I really appreciate all the help and suggestions you guys have been giving me and I'm in over my head here. I have to just assess the easiest angle to come at this

    Regards
    Des
  • oodesoodes Posts: 131
    edited 2013-10-25 15:57
    Mike ,
    As coder96 pointed out, it's easier implement a file copy/move using a PC/Server on the network. The PC/Server asks the Spinneret, Hey man - you have any files? The Spinneret response with a list of files name. The PC/Server downloads each file with a simple HTTP GET and saves the files in the network share.

    Cool, Im just seeing your post now. This sounds like it the best way to go. Can i write this with VB.net or something or something even easier maybe :D? This is a major project for me and I have a bit of time to spend at it , so im looking to get my hands dirty

    Des
  • Mike GMike G Posts: 2,702
    edited 2013-10-25 16:43
    Can i write this with VB.net or something or something even easier maybe ?
    The programming language is not important... but yes you could use VB.NET if that floats your boat.

    You're better off thinking about this project (problem) in small chunks. Here's an example...

    Hey man - do you have any files?
    Either the Spinneret or the PC/Server must determine if there are any files to move. Who has the responsibility, the Spinneret or the PC\Server? If the PC has the responsibility then then you're knee deep in VB.NET, otherwise you're knee deep SPIN.
  • oodesoodes Posts: 131
    edited 2013-10-26 01:29
    Cheers lads ,

    Ok sound, now I can tackle it from the right angle. Guess its time to get knee deep :D
Sign In or Register to comment.