UPDATED: Having issues with getting Spinneret talking to RFID Read Write module.
Greetings.
I am working on a Networked RFID Door and Equipment access system for a shared workspace. I am having some trouble with the SPIN examples for the Parallax RFID Read/Write module.
Testing on Mac and Windows. Running Mac Book Pro and Running an AMD Windows 2008 box.
Was able to write simple programs and upload them to the Propellor Chip. Was able to get some readings with Viewport. So things are communicating fine on both platforms.
I issues with the BST specifically. In attempting to test the http://obex.parallax.com/objects/656/ RFID Read Write test SPIN code. Don't seem to be able to transmit the control commands through the PST or the BST. In BST I do not get the same windows that are depicted in the manual.
Has anyone had success with this object?
Has anyone had a similar issue with BST?
An insight is appreciated. I have to really get this system up and running in the next week.
Best,
Luke
I am working on a Networked RFID Door and Equipment access system for a shared workspace. I am having some trouble with the SPIN examples for the Parallax RFID Read/Write module.
Testing on Mac and Windows. Running Mac Book Pro and Running an AMD Windows 2008 box.
Was able to write simple programs and upload them to the Propellor Chip. Was able to get some readings with Viewport. So things are communicating fine on both platforms.
I issues with the BST specifically. In attempting to test the http://obex.parallax.com/objects/656/ RFID Read Write test SPIN code. Don't seem to be able to transmit the control commands through the PST or the BST. In BST I do not get the same windows that are depicted in the manual.
Has anyone had success with this object?
Has anyone had a similar issue with BST?
An insight is appreciated. I have to really get this system up and running in the next week.
Best,
Luke

Comments
Have you changed the RFID I/O pins to available Spinneret Prop pins?
How do you have things connected? Powered? What kind of RFID module to you have? What manual?
If you are expecting serial data back on the Mac you will need to dowload a terminal program. I suggest Coolterm. BST on the mac has not terminal window to open - you have to manually launch one to see results.
Brandon_L
Will go test these ideas now. I was attempting to assign pin 25 and 26 as the RX TX between the chip and the RFID R/W. How can I use pins 30 and 31 be used to communicate with the RFID module SIN SOUT if they are used to communicating with the prop plug? I was under the impression that any of the free pins could be used for I/O. I would prefer to use pin 25 and 26 if possible. This way I can keep system connected with prop plug as I iterate. Plus pins 25 and 26 are accessible on the proto-board. Does that make sense?
The RFID module is the Parallax RFID Read Write module Serial. Item number 28440
Everything seems powered fine. I can write programs to the Prop chip. Powered by 5 volts though an mbed on the bench. Will be switching to a external 5 volt power suppply when i install. Don't think it is a power issue.
I have the Parallax RFID working with an Arduino now. Since I was familiar with that chip. I used it for the first iteration. Was able to get it communicating with the Chip and feeding data back to the mac with little effort.
I did download iTerm in an attempt to get it working before. Will try again and with CoolTerm after tweaking.
Best,
Luke
The "Host" alias sends messages to the PST. HOST does NOT communicate with the RFID. The two constants below define RFID Rx/Tx. This is also clearly published in your source code reference. I take it you're running updated code but referenced the original code? Not really, iterate what?
What protoboard? Did you build a circuit?
If you want help please better describe you setup and post the code that you actually have loaded in the Prop.
I mean iterate in the sense of making sequential versions of a thing. Each one adding functionality. For instance; When I get the RFID module talking to the prop chip and sending data back to the terminal. The next iteration will involve sending the data over the network. The next iteration of the system will compare the data read from the card and sent through the network to a data base and make a comparison. It will then return a 1 or a 0 and unlock a door. The next iteration we will implement some rules for what to do if the network is down. And so on.
With Regards to the Proto Board:
http://www.parallax.com/Store/Microcontrollers/BASICStampDevelopmentBoards/tabid/137/txtSearch/spinerette/List/0/SortField/4/ProductID/469/Default.aspx
Parallax's Prototyping Daughterboard is a convenient through-hole board that allows you to build your own circuits for the MoBoStamp-pe motherboard, the Propeller Backpack, and the Spinneret web server.
Yes I built a circuit and custom Makerbot printed enclosures for this system.
With regard to the TX and RX listed in the code:
My understanding is that these are the pins that are connected to the RFID module
and not the host computer. It does clearly say to SIN an SOUT of the RFID module.
Ah ... I think I see your point. I should change the FDS pins to 30 and 31? I overlooked that they were set to 29, 28
Luke
Luke
Please update the OP subject line from unsolved to solved.
I have not gotten the serial to work though the mac. Working fine with the PC. Tried Cool Term. Going back over it now. Hmmmm?
Brandon_L
Glad to hear that the deadline on the contest was extended. I think I can have a really refined hardware and software and documentation with the extra time.
Will take and post some pictures as it progresses.
Thanks for the help.
Also, I have a question. When is the right time to start a new thread? I really wonder about this.
Going to turn the end of this into a mini update about the project and the contest. But maybe that should be a new thread?
I am really hacking up the examples and drivers I found for both the RFID and Spinneret. I know this thing is a bit of a Frankenstein right now but I think that once I get the main goals accomplished I will refine it ....... and rewrite some of what is being handled by the existing SPIN libraries and drivers. Especially since this is a pretty simple UI. It only does a few things over and over.
Have the whole circuit with me on a trip to Philadelphia to collaborate with the network - back-end programmer. In a simple first iteration enclosures that I designed in Blender and printed on the Maker-Bot. Right now they are form fit enclosures. But later versions will be more ornate. I am transporting the system in a nice molded case, with a clear lid that I picked up in Akihabara.
I want to post where ever I am at with the project code wise tomorrow. Would appreciate some feedback about things as I get to know the Prop better. I am confused a bit right now when to call a new cog ......
With regard to the SPIN programing ..... I have all the basic parts working. Just not together yet. Some working conditional statements but things are seemingly working in an either or manner. Thinking this is where I need to understand cog management and how to manage the transitions between process and states of this system. Have both the Propeller Manual and the The Official Guide Programming and Customizing The MultiCore Propeller Microcontroller books. So reading on the forum and Object repository as well as referencing the books. Obviously chapter 8 Using Multicore for Networking Applications is interesting. Going over Chapter 3 (Debugging code for multicore) again now. I cam curious if it would be worth while for me to fire up the View Port demo?
Awesome 3d prints! I got it worked out on the Mac. Your Baud rate is wrong. Your set for 57,600 - you need 115,200. Set the port to your Propclip. You need to then hit the connect button. BST can not write to the propeller if the terminal is connected. To use BST you have to hit the disconnect button.
Brandon_L
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 DAT hello byte "Hello World!", 0 OBJ pst : "Parallax Serial Terminal" PUB Main pst.StartRxTx(31, 30, 0, 115_200) waitcnt((clkfreq / 1_000 * 1_000) + cnt) repeat Print(10) pst.char(16) PRI Print(numOfLines) repeat numOfLines pst.str(@hello) pst.char(13) pst.char(10) waitcnt((clkfreq / 1_000 * 500) + cnt)Here is what I have come up with so far. I have not tried this one on the hardware yet but will either later today or tomorrow morning. It is made from working bits of code that were individually tested.
It does compile so that is a good start. Thinking most of the day tomorrow and Thursday will be testing working
out the bugs. I have to have a working version accessing the database by Friday. So any insight or advice would be greatly appreciated. This is my first program with SPIN so if you see anything blatantly wrong please advise me.
A few things I am curious about: The way this is set up now; I am using REBOOT to get back to the listen mode loop state. I am speculating that there is a better way to do this. Also, not sure if I should ideally be using if or if else or repeat until statements in certain circumstances.
Sorry the format of the code is so wide. Was working on 24 inch screen and got carried away.
Luke
Networked RFID Door and Equipment Access System Copyright (c) Luke Schantz 2011 , OCD, OCD and ADD Technology Trust Please review the end of this file for conditions and terms of use. Based on the following drivers and code examples: Easy WebServer DEMO2 (build 01_28_2011) v1 RFID RFID Read/Write Object Wrapper WIZnet W5100 SPI Driver Ver. 00.14 Development Road-map for System Phase 1 - Completed May 2011 A Stand Alone Un-Networked RFID Card system for access to Think Tank and Media Lab @ The 3rd Ward Incubator for Innovation. Built using an Arduino Decimia, a handmade Proto Sheild (made by Kimio Kosaka), Sparkfun Relay Board, Parallax and Grand Design Studios RFID Read and Write Module and an existing preinstalled 12 Volt Door Strike and a door bell style button. The system is enclosed in a series of enclosures custom built on a Makerbot Thingomatic. This first prototype system is installed in the Lobby's Think Tank Door @ The 3rd Ward. It has been working with uninterrupted service for approximately one month. It will be replaced by the Phase 2 iteration of the system which is based on the Parallax Spinerette Web Server. Phase 2 - Deadline June 10, 2011 A Networked RFID Door Access Node that is integrated with the networked database and member system. Built using the Parallax Spinnerette Module, Proto Daughter board, Parallax and Grand Design Studios RFID Read and Write Module, Sparkfun Relay Board, 12 volt door strike and door bell style button. Phase 3 - Deadline July 1, 2011 Installation of 3 Networked RFID Nodes into The 3rd Ward Incubator for Innovation Will be very similar to the Phase 2 version but will contain indicator lights and redesigned enclosures. Phase 4 - 2012 Module based on the RFID Door Access System that can be retrofitted into a variety of Shop Tools, other equipment, computers and cabinets. Technical Specifications and Code This system has 3 main states or modes. 1.0 - Listen Mode Loop 1.1- Keep door Locked - PIN 24 LOW 1.2- Start RX TX for RFID R/W Module 1.3- Send RFID R/W module Hexadecimal Read command 0X01 note: the module only stays in read mode for approximately 25 seconds 1.4- Wait for 20 Seconds for RFID Data 1.2.1 - If RFID Data is present 1.2.1.1 - Write it to Buffer 1.2.1.2 - Start Sever Communication Mode 1.3 - If no RFID data read after 20 seconds restart Listen Mode Loop - repeat or Reset? 2.0 - Sever Communication Mode 2.1 - Open Socket to web server 2.2 - TX - HTTP POST - Request Session Token 2.3 - RX - Receive Session Token 2.4 - Combine? or send send sequentially in POST? Token and RFID Data 2.5 - TX - HTTP POST - Send Token and RFID Data 2.6 - RX - Receive Server response and stores it in buffer 2.7 - Close Socket connection 3.0 - Door Access Mode 3.1 - Parse buffer Data 3.1.1 - Sever responded 0 o 3.1.1.1 - Access Denied Indicator LED r 3.1.1.2 - Restart Listen Mode Loop 3.1.2 - Server responded 1 3.1.2.1 - Access Granted Indicator LED 3.1.2.2 - Door Strike Unlock - PIN 24 High 3.1.2.3 - Wait 5 Seconds 3.1.2.4 - Start Listen Mode Loop }} CON _clkfreq = 80_000_000 _clkmode = xtal1 + pll16x socket = 0 listenPort = 80 RFID_TX = 25 ' Connects to RFID R/W Module SIN RFID_RX = 26 ' Connects to RFID R/W Module SOUT OBJ DHCPClient : "DHCP_GBSbuild_01_28_2011.spin" RTC : "s-35390A_GBSbuild_01_23_2011" PST : "Parallax Serial Terminal" Host : "FullDuplexSerial" RFID : "RFID.Reader.Writer.Driver" VAR long IP, SubnetMask, GatewayIP, DNS_Server ,destIP byte MAC_Address[6], data[DHCPClient#BUFFER_SIZE] VAR byte TestBuffer[ 12 ] byte TestDataBuffer[ 32 * 4 ] byte OldPwdBuffer[ 4 ] byte NewPwdBuffer[ 4 ] byte HostDataBuffer[ 10 ] long scsstack[ 6 ] byte token[ 4 ] byte access[ 1 ] VAR byte ButtonSelected byte Stringbuffer[100] PUB listenMODEloop '| ErrCheck, CmdByte, LoopCounter, IndexCounter, Offset LISTEN MODE LOOP '1.1- Keep door Locked - PIN 24 LOW - Do I need this or will 'it be low by default. Thought it would be good to define 'the door as locked though. DIRA[24] := 0 OUTA[24] := 0 '1.2 - Start RX TX for RFID R/W Module RFID.Start( RFID_RX, RFID_TX ) 'pub startRFIDread 'REPEAT 'until @TestDataBuffer <> 1 '1.3 - Send RFID R/W module Hexadecimal Read command 0X01 'Host.str( string( "Trying to read all card data...", 13 ) ) bytefill( @TestDataBuffer, 0, 128 ) Result := RFID.TryToReadCardData( @TestDataBuffer, 0, 32, 5 ) 'if Result <> 0 'waitcnt ( 50_00_000 + cnt ) 'From the EasyWeb Server Demo. TryToReadCardData is sending the Hexadecimal 'message 0X01 to the RFID module. TestDataBuffer is data from RFID card. Should 'eventually be renamed to something more descriptive for our use. 'This is not working so well yet. This is supposed to start the 'server communication routine. IF the test TestDataBuffer is filled with RFID data. 'Otherwise it should wait no more than 20 seconds and send the TryToReadCardData message 'to the RFID module. 'The RFID module seems to only stay in read mode for about 25 - 30 seconds. 'This is indicated by the green power light turning red. 'So after about half a minute it returns to green and the message needs to be sent again. 'Would this be better as "repeat until" or a "if else" statement? '1.3 - Wait for 20 Seconds for RFID Data repeat until ( @TestDataBuffer ) => 0 waitcnt ( 1_600_000_000 + cnt ) reboot '1.4 - If no RFID data read after 20 seconds restart Listen Mode Loop 'Should it be something like written below? {{ if ( @TestDataBuffer ) => 0 cognew ( serverCOMmode, @scsstack ) else waitcnt ( 10_000 + cnt ) clkset ($80, 0) }} PUB serverCOMmode|i1,i2',x ' x := 2 RTC.start 'Initialize On board RTC XXXXXX This was from the webserver demo. Maybe I don't need it. Unless it would be 'usefull for calculating time in seconds. Should this possibly happen earlier in the program? ' RTC.SetDateTime(month, day, year, dayOfWeek, hour, minutes, seconds) '<- Just do this once to set time '2.1 - Open Socket to web server PST.start(115200) 'Initialize Parallax Serial Terminal ' Network Settings DHCPClient.IPs(@IP,192,168,1,110) ' IP ; a static address of the router DHCPClient.IPs(@SubnetMask,255,255,255,255) ' SubnetMask ; see: www.subnet-calculator.com DHCPClient.IPs(@GatewayIP,192,168,1,10) ' GatewayIP ; your local router's address DHCPClient.IPs(@DNS_Server,192,168,1,10) ' DNS_Server ; usually same as Gateway DHCPClient.IPs(@destIP,0,0,0,0) ' Dest IP can be all zero's DHCPClient.MAC(@MAC_Address,$00,$08,$DC,$16,$F1,$3C) ' MAC address located on spinneret ' Initialize Wiznet 5100 chip DHCPClient.Wiznet5100(socket, @MAC_Address, @GatewayIP, @SubnetMask, @IP, @destIP, listenPort) ' Infinite loop of the server ; listen on the TCP socket ButtonSelected :=1 repeat if DHCPClient.HTMLReady(@data)==0 'Is connection ready to send HTML? 'Thinking this could and should be changed 'to check if the card data buffer is loaded? 'PST.Char(0) ' PST.str(@data) 'ParseDATA(@x) ' '2.2 - TX - HTTP POST - Request Session Token DHCPClient.StringSend(socket, @TolkenRequestHeader) '2.3 - RX - Recive Session Token DHCPClient.rxTCP(socket, @access) '2.4 - Token and RFID Data Buffers. Combine or send sequentially? 'This might not need to exist as when AccessRequestHeader is called 'it will just 'combine into a string or just as POST elements@tolken, @TestBufferData '2.5 - TX - HTTP POST - Send Token and RFID Data DHCPClient.StringSend(socket, @AccessRequestHeader) '2.6 - RX - Recieve Server respose and stores it in buffer DHCPClient.rxTCP(socket, @token) '2.7 - Close Socket connection DHCPClient.NoPersistanceAllowed(socket) PUB doorACCESSmode if @access := 1 '3.1.2 - Server responded 1 'DIRA[??] := 1 '3.1.2.1 - Access Granted Indicator LED 'OUTA[??] := 1 DIRA[24] := 1 '3.1.2.2 - Door Strike Unlock - PIN 24 High OUTA[24] := 1 waitcnt ( 400_000_000 + cnt ) '3.1.2.3 - Wait 5 Seconds '3.1.2.4 - Start Listen Mode Loop reboot 'I realize this is not ideal. Trying something different soon. 'Should I use cognew or a start comand to restart Listen Mode Loop? 'o 'r if @access := 0 '3.1.1 - Sever reponded 0 'DIRA[??] := 1 '3.1.1.1 - Access Deined Indicator LED - 'Commented out for now as the LED part of the circuit 'will be implemented in next version. 'OUTA[??] := 1 'waitcnt ( 20_000_000 + cnt ) reboot '3.1.1.2 - Restart Listen Mode Loop 'listenMODEloop.start 'or 'cognew DAT TolkenRequestHeader byte "<POST / HTTP/1.1>" byte "< Host: 192.168.1.1>" byte "<Connection: close>" byte "<User-Agent: Web-sniffer/1.0.37 (+http://web-sniffer.net/)>" byte "<Accept-Encoding: gzip>" byte "<Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7>" byte "<Cache-Control: no-cache>" byte "<Accept-Language: de,en;q=0.7,en-us;q=0.3>" byte "<Referer: http://web-sniffer.net/>" byte "<Content-type: application/x-www-form-urlencoded>" byte "<Content-length: 1>" byte "<Tokenreqyest: (@tokenrequest)>" AccessRequestHeader byte "<POST / HTTP/1.1>" byte "< Host: 192.168.1.1>" byte "<Connection: close>" byte "<User-Agent: Web-sniffer/1.0.37 (+http://web-sniffer.net/)>" byte "<Accept-Encoding: gzip>" byte "<Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7>" byte "<Cache-Control: no-cache>" byte "<Accept-Language: de,en;q=0.7,en-us;q=0.3>" byte "<Referer: http://web-sniffer.net/>" byte "<Content-type: application/x-www-form-urlencoded>" byte "<Content-length: 34>" byte "<Token: (@token)>" byte "<RFID Data: (@TestBufferData)>" OBJ {{ ┌───────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TERMS OF USE: MIT License │ ├───────────────────────────────────────────────────────────────────────────────────────────────────┤ │Permission is hereby granted, free of charge, to any person obtaining a copy of this software and │ │associated documentation files (the "Software"), to deal in the Software without restriction, │ │including without limitation the rights to use, copy, modify, merge, publish, distribute, │ │sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is │ │furnished to do so, subject to the following conditions: │ │ │ │The above copyright notice and this permission notice shall be included in all copies or │ │ substantial portions of the Software. │ │ │ │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT │ │NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND │ │NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, │ │DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE │ │SOFTWARE. │ └───────────────────────────────────────────────────────────────────────────────────────────────────┘ }}I'm sorry; but there are a few problems with your posted code. Execution never leaves "listenMODEloop". The W5100 is never fired up (initialized).
I would..
Create an RFID process that reads RFID data and writes to memory. I'd spin this up in a new COG. This will remove the need for a REBOOT.
Create another process that reads the same memory location and does whatever processing is required. Finally it clears the RFID data for the next write.
Initialize the W5100 at start up.
Luke
Brandon_L
Brandon_L