Thursday, December 29, 2016

Recompile with -fPIC when compiling Samba with ACL

I ran into a problem trying to compile Samba under a Linux From Scratch (LFS) system :
    
    relocation R_X86_64_32 against function can not be used when making a shared object; recompile with -fPIC
    /usr/lib/libacl.a: could not read symbols: Bad value
    
I kept trying to figure out what was up with my Samba ./configure arguments. It took a while to realize the problem wasn't in my Samba methods - it was in the ACL compilation. When the Samba error in the make specified about recompiling with -fPIC, you need to recompile the library that it is trying to link. I had to recompile the libacl.so binary and fix it, and then Samba compiled fine.

Sunday, December 18, 2016

FAILED: Has an address record but no DHCID, not mine.

I am running a little DHCPD/DNS/SQUID server, and after enabling logwatch, I started receiving e-mails in the morning about the following errors :
    Dec 18 19:58:06 home dhcpd: Forward map from computername.home.silverhawk.net to 10.0.0.6 FAILED: Has an address record but no DHCID, not mine.
    
The computername is not a generic DHCP client - it is a host with a statically assigned address.  This message is somewhat annoying.  To remediate this, I have now added a "ddns-update-style none;"  to each host with a static address, e.g. :
    host computername {
            hardware ethernet       00:25:8c:7f:ef:01;
            fixed-address           10.0.0.6;
            ddns-update-style       none;
    }
    
I may just turn off the dynamic updates all together.  I am not sure they are as important as I initially thought.  We'll see if this will swallow the error first, though.

Sunday, December 4, 2016

New Project From Old, Small Gears

So, if you look closely at the background for this web page, you will see a number of gears turned into a seamless pattern.  Yes, I did that work.  The gears have an interesting history.  My father pulled out an old box one day, and wanted me to check it out.  He pulled three cans of small, aluminum and brass gears out of the box.  As if that wasn't enough, there was a small box containing a worm drive, a few spindles, and some very small pulleys.

I quickly realized that there were different sizes of gears.  The box was given to me before I was really understanding "pitch", "pressure angles" and other attributes associated with gear engineering.

Someone had a suggestion for me, and it is becoming a new project.  Take my fathers old gears that he used to play with as a teenager (yeah, Xboxes, Nintendos, and Segas did not exist - this hails from the time he had to drag his pet dinosaur to and from school through 10 feet of snow, uphill both ways), and turn them into a new table.

My dad does not drink coffee.  So, we shan't call it a coffee table, we'll call it a "hot chocolate table". My family will build a cocoa table using his gears, as a gift to him.  This will be a large project, and hopefully won't take more than 20 years to complete (that is reserved for my car).  Here's what has to be done :
  • Build a gear "depthing" tool - it's a tool in horology (the science of clock making) that is used to set spacing for gears of specific sizes - see a great video from clickspring (youtube) on how to make one
  • I need to figure out how to drill holes in glass - if you want to make a table with a working gear train, you need to be able to see the working gear train - and, since it will be a cocoa table, it will need to be flat so he can put his papers on it, too
  • I need to determine if I should have it powered - meaning plugging the table into an outlet to work itself - and if I need to add some LED lighting accents - or, if I create a lever somewhere that someone can turn to work the gear train
  • I need to determine if there will be small drawers to house things like pens and pencils
The first step is to plan out a basic design.  Something people don't realize is I sketch on paper and a drafting table, not on a computer.  So, I'm starting to get some dimensions so I can build a mock-up design (the mockup will be digital).  Once I have dimensions, I can start to throw together a basic outline on the drafting table that can be photocopied multiple times for various sketches.  Of course, I'll need my families opinion as I go, and probably involve nieces/nephews in the build.  Also, I think I might just do a single page in this entry, so you won't see this until the table is done.  You still get to see the project chronologically throughout the build, and that is what is important.  I see the following basic steps :
  1. Determine requirements (drawers, power, etc)
  2. Determine the count of gears
  3. Sketches/designs that look good
  4. Manufacture needed tools to make it happen
  5. Layout basic table drawings with everything
  6. Learn how to drill holes in glass without breaking it (practice!)
  7. Build the frame
  8. Source safety glass for the table
  9. Build the wooden areas of the table (if there are any)
  10. Create mounting points for the glass, wood, and gears on the frame
  11. Use added layers of glass for the spindles of the gears (must have a second layer of glass for the final, finished surface)
Of course, it might be easier to use plexiglass on the inside of the table, which would mean I don't have to drill glass, just plastic.  Plus, it would be protected from scratches by real safety glass.  Well, I'll come to that bridge when I need to cross it!

Requirements

Discussions with family means that this table should NOT have any power plugs.  That means, for the gears to run, I would need include batteries for the gears to turn, somehow.  I'll probably use drawers, and have one of those drawers house the batteries.  It means I'll need some wood furnishing, too, but I'd like it to be a bit "industrial", having some bare steel that has been clear-coated to protect it from corroding - however, suggestions from family are to fit in with the rest of the furniture, which is primarily wood, without much bare metal.

Materials that NEED to be used

TeethCountOutside DiaShaft Dia
19244.0380.75
15613.28650.115
14423.0380.234
13412.82950.465
12012.5380.2
11812.4960.355
10012.12050.375
9652.03750.107x2
0.247x3
9111.93250.375
9041.9150.1285
0.245
0.5
8011.70350.2425
7281.53950.243
0.5
0.228
0.232
7011.4950.375
6031.28850.179
0.2265
0.25
5831.250.512
0.375
54161.16350.2275
0.241
0.233
0.2965
4891.03850.48
0.357
0.25
4530.9760.226
4430.9610.2265
3610.7850.353
I have to have a list of the gears that are going to be used, but the gears are all jumbled together.  I separated the gears into compatible teeth (the gears can mesh), and did the calculation on diametral pitch (see my South Bend Gearing page for more details on the calculations). The 192-tooth gear is 4.031" in diameter, which calculates to a pitch of 48.1270156288762.  That seems to be an odd number for a pitch, so (for kicks and giggles) I calculated the approximate diameter of the 192-tooth gear if it had an even pitch of 48.  It calculated to 4.01667" -  not far off (only 0.016").  I may just call them 48 pitch gears, though the pitches are not the same.  The gear inventory list is off to the right.

The gear spindles (from the "shaft diameter" in the chart) are 0.107, 0.115, 0.1285, 0.179, 0.2, 0.226, 0.2265, 0.2275, 0.228, 0.232, 0.233, 0.234, 0.241, 0.2425, 0.243, 0.245, 0.247, 0.25, 0.2965, 0.353, 0.355, 0.357, 0.375, 0.465, 0.48, 0.5, 0.512, and 0.75 inches.  Trying to get them "close" in proximity to diameters shortens the list to 8 diameters :

0.1", 0.2", 0.25", 0.3", 0.375", 0.465", 0.5", 0.75"

Now, I need to plan out the gear train.  I've started thinking I could turn this into a clock, using a stepper motor, but that will require knowing some very specific gear ratios. I do have an extra stepper motor hanging around, so I know I can do that, but it will take some very careful planning on my part, and possibly an RTC (Real Time Clock) module in some electronics design.  We shall see how that turns out.

Sketches

I needed to obtain approximate dimensions of what I am going to produce, so the family all pitched (no pun intended with a gearing post) in to get me approximate dimensions.  Our cocoa table is 24" x 48" x 15".  However, the request came in from family at no more than 30" x 46", and about 20" tall.  I'll keep the width about the same, 24",  and I'll shorten the length to about 44".  The adding of 5" will remain because people are going to want to see and explore this table (it's the way my dad is).  So, the resulting dimensions of the cocoa table will be sitting about 24" x 44"x 20" tall.  I dropped the dimensions onto an 8.5x11 sheet of paper using a drafters scale and tossed out a couple of sketches :







Yes, I included a blank one in case someone had a better design for the table. No one took me up on that. One of those designs (I won't tell you which one) was done by my niece, who is 8.

Additionally, the designs (from "glass and steel" to "glass and wood" with a number of variants in between containing glass, wood and steel) were sent to family, and a couple of weeks allowed to get some sort of consensus on which design to use.

The voting results came in from the family as :


60% of the votes went to :

20% went to :

And the other 20% went to :

I need to draw up an official orthographic depiction of the table, and the plans, and then identify the gear layout.

I can now start sketching the layout and get the dimensions of the glass area of the table.  Once I have the glass area dimensions defined, I can start to generate gear trains, then lay out the gears onto paper.  Once that is complete, it will be time to build the table!

Tooling

It's the start of December, and I finally repaired the lathe and finished the base for the gear depth tooling.  The shuttle frame is based on a 1 1/4" chunk of flat bar from Home Depot that I milled a 3/8" slot into.  The two shuttles were turned on the old South Bend to the dimensions identified in the following image from a piece of brass round bar stock (3/4" diameter).  The knurl is simply to allow me to tighten and loosen the shuttles from the frame.  The 3/8-16 thread on the frame-side shoulder did not go all the way to allow a smooth shoulder to fitfit perfectly into the milled slot in the frame with a nut on the other end.  This end was also drilled with a #25 drill bit about 0.5" deep, and then tapped with a #10-24 tap to allow a #10 course thread bolt.  The other shoulder (the one with the needle) was turned down to about 1/2" (I say about because one is 0.5" and the other is 0.4995"), at about 3/4" long.  A #42 drill was used in the needle side about 1/2" deep in order to hold the #14-sized needle.  Two needles were snipped about 1.25" long, then hardened, and then thread locker added to hold the needles in.



The two shuttles attach to the frame with simple 3/8"-16 nuts, and tighten solidly onto the frame.



My next task is to set up the shuttle bushings for specific gear bores identified above.  This means that I now need to turn some bushings that have a #10-24 threaded bolt surface (about 0.196" diameter before cutting threads with the die) about 3/8" long that will screw down into the shuttles.  I need a 0.30-0.31" diameter, 0.125" long collar to ensure the flange where they meet is not interfered with by the nuts holding the shuttle to the frame.  I also need about a 0.25" long (diameter doesn't matter) surface next to that one for a knurl, followed by the actual bushing diameter for the gears, about 0.675" to 0.75" long - length isn't as critical here.  The diameters for the bushings are, again, 0.1", 0.2", 0.25", 0.3", 0.375", 0.465", 0.5", and 0.75" across.  For example, a quick drawing plan (really straight lines, and I got the threading lines as left-handed instead of right handed) might look like :


Those things can then be used to have the gears placed on them to get the distance between the bores for a good gear mesh, and then you can place the needles down, one on one point, and the other where you want it, with a light tap on the hammer to get the proper dimensions for gear placement.



That will then allow me to lay out the entire gear train in the right environment.

As of 2 February 2017, I have currently done the 0.75" bushings (in brass), 0.5" bushings (steel), 0.465" bushing (steel), 0.375" bushing (steel), and 0.350" bushing (steel). That leaves me 0.100", 0.170", 0.220", 0.240", and 0.295". I only have 8 bushings left!

And, as of February 4th, I now have the 0.295" bushings. All of you machinists, please ignore the finish - I really don't care about the finish because as soon as I'm done, the tool goes with the table in a box, probably to never be seen again. The set currently looks like :



I am slowly making progress.  I have 8 out of the 18 bushings left, and they are the 0.100", 0.170", 0.220", and 0.240" bushing pairs.

I finished off the bushings.  The test looks good :




After finishing that tool, the next phase is to get a full layout of the entire table so that I can start placing gears.  The layout will go in a 2-dimensional format, and then we have to add a third dimension on gears protruding through the long braces that will give the table stability.  The table is really starting to take shape in my head (the design phase is still going on) :





I finished the over-all layout, then I finally had a chance to start laying out the gears.  I did not want to destroy the original layout.  Fedex-Kinko's came to the rescue with their large photocopier (used rolls of paper).  I ran three off in black and white (in case I flubbed something up, which would be par for the course).  Then I threw one of the copies onto the temporary "workbench" on the back patio and started marking things out.

Basically, I started with a single gear, marked the center on the layout, and then used a compass to draw a rough estimate of the gear.  From there, it was a matter of using the gear depthing tool made earlier to get things marked and in position on the layout page.





So, I need to finish the gear spacing definition (call it the gear map from here on out), then I'll merge the map with the original drawing, take it back to FedEx-Kinko's and run three full-color copies.  That will allow me to keep one for myself, send the original to my Father, and use the second and third copies to actually mark where the spindles for each gear need to be.  This is going to take a while.

After a few hours this past weekend (May 6th), and then spending another three and a half hours tonight, I am finally about 2/3rds of the way done :







I finished up the final two chains :



I started to question the fact that some lines were overlapping too much for my sanity.  I had a few gears that overlapped when they shouldn't have, and I thought it was because I simply drew the circle too large when drawing them because setting the compass to half the outer gear diameter was so imprecise.  Out of curiosity, I put the calipers up against the bushing centers, and then again against the tips that were used to mark the layout.




I had a difference of a whopping 0.050", meaning I didn't get the bushings completely concentric!  I ran a few tests to make sure it wasn't the shuttles, and those seemed to be okay.  Going back to the bushings, I realized that there is a big difference between cutting threads on bushings with the lathe versus using a die in getting things concentric.  The die cut the threads at an angle, causing the bushings to be slightly out of alignment at times, depending on the shuttle base.  So, it means I cannot trust the layout done with that tool.  That's a lot of wasted hours (60, to be more specific).  Hours spent like this :



But, if I do my math right, it's not totally wasted.  I can use that previous map as a visual layout, and then use the real compass on a drafting table.  That's right.  The results of those wasted hours can give me an overview of where it all needs to go, and the math should get me exact enough to work it.

So... to start over on the gear chain layout.  I HAVE to get that right.  When 0.050" can mean the difference between being too tight to turn or too loose to even engage the gear teeth, I have to be much better on those tolerances.

Remaining To-Do's

Here is the list of things I have to do :
  • Finish Full-Sized Table Gear Map (then plans will be complete)
  • Build Wood Table, and finish appropriately
  • Cut Four Pieces of Glass and Plexiglass To Dimensions, Bending for radius'd corners
  • Drill holes in plexiglass to act as a holder for gear spindles
  • Turn down gear spindles (I MUST get a good finish on these, as visitors will be able to see them, and they have to be polished to prevent binding in the plexiglass frame)
  • Drop in lower glass, then lower plexiglass, add the spindles and gears, add the top plexiglass over the spindles, the upper glass
  • Test the gear train
  • Add RGB LED Lighting
  • Relax


Tuesday, November 15, 2016

Multiple SSIDs hostapd on CentOS 7

Here's how I set up hostapd on my CentOS 7/PCEngines APU 2C4.  First, I needed to ensure I had the capabilities.  I'm using the WLE200NL device.

my setup for hostapd :
    [root@hostname home]# yum install iw
    
Next, I needed to check and ensure the driver would work as an Access Point, so I ran an "iw list" :
    [root@hostname home]# iw list
      Wiphy phy0
      max # scan SSIDs: 4
      max scan IEs length: 2257 bytes
      Coverage class: 0 (up to 0m)
      Device supports RSN-IBSS.
      Device supports AP-side u-APSD.
      Supported Ciphers:
        * WEP40 (00-0f-ac:1)
        * WEP104 (00-0f-ac:5)
        * TKIP (00-0f-ac:2)
        * CCMP (00-0f-ac:4)
        * 00-0f-ac:10
        * GCMP (00-0f-ac:8)
        * 00-0f-ac:9
        * CMAC (00-0f-ac:6)
        * 00-0f-ac:13
        * 00-0f-ac:11
        * 00-0f-ac:12
      Available Antennas: TX 0x3 RX 0x3
      Configured Antennas: TX 0x3 RX 0x3
      Supported interface modes:
        * IBSS
        * managed
        * AP
        * AP/VLAN
        * WDS
        * monitor
        * P2P-client
        * P2P-GO
      Band 1:
        Capabilities: 0x11ce
          HT20/HT40
          SM Power Save disabled
          RX HT40 SGI
          TX STBC
          RX STBC 1-stream
          Max AMSDU length: 3839 bytes
          DSSS/CCK HT40
        Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
        Minimum RX AMPDU time spacing: 8 usec (0x06)
        HT TX/RX MCS rate indexes supported: 0-15
        Bitrates (non-HT):
          * 1.0 Mbps
    [...snip...]
          * 54.0 Mbps
        Frequencies:
          * 2412 MHz [1] (30.0 dBm)
    [...snip...]
          * 2484 MHz [14] (disabled)
      Band 2:
        Capabilities: 0x11ce
          HT20/HT40
          SM Power Save disabled
          RX HT40 SGI
          TX STBC
          RX STBC 1-stream
          Max AMSDU length: 3839 bytes
          DSSS/CCK HT40
        Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
        Minimum RX AMPDU time spacing: 8 usec (0x06)
        HT TX/RX MCS rate indexes supported: 0-15
        Bitrates (non-HT):
          * 6.0 Mbps
    [...snip...]
          * 54.0 Mbps
        Frequencies:
          * 5180 MHz [36] (17.0 dBm)
    [...snip...]
          * 5825 MHz [165] (30.0 dBm)
      Supported commands:
    [...snip...]
        * start_ap
        * new_station
    [...snip...]
        * connect
        * disconnect
      Supported TX frame types:
    [...snip...]
        * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
        * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
        * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
    [...snip...]
      Supported RX frame types:
    [...snip...]
        * managed: 0x40 0xd0
        * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
        * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
    [...snip...]
      software interface modes (can always be added):
        * AP/VLAN
        * monitor
      valid interface combinations:
        * #{ managed } <= 2048, #{ AP } <= 8, #{ P2P-client, P2P-GO } <= 1,
          total <= 2048, #channels <= 1, STA/AP BI must match
        * #{ WDS } <= 2048,
          total <= 2048, #channels <= 1, STA/AP BI must match
      HT Capability overrides:
    [...snip...]
      Device supports AP scan.
    [root@hostname home]#
    
I snipped out some of the repetitive-styled output (marked by the "[...snipped...]" lines), just to shorten the output of the iw command.  I highlighted a couple of the things I thought were relevant in bold.  I needed to grab the source for hostapd :
    [root@hostname home]# wget http://w1.fi/releases/hostapd-2.6.tar.gz
    
Extract it (tar -xf hostapd-2.6.tar.gz), then configure it (note, no ./configure script) :
    [root@hostname hostapd]# cd hostapd-2.6/hostapd
    [root@hostname hostapd]# cp defconfig .config
    
    [root@hostname hostapd]# make
      CC  main.c
      CC  config_file.c
      CC  ../src/ap/hostapd.c
      CC  ../src/ap/wpa_auth_glue.c
      CC  ../src/ap/drv_callbacks.c
      CC  ../src/ap/ap_drv_ops.c
      CC  ../src/ap/utils.c
      CC  ../src/ap/authsrv.c
      CC  ../src/ap/ieee802_1x.c
      CC  ../src/ap/ap_config.c
      CC  ../src/ap/eap_user_db.c
      CC  ../src/ap/ieee802_11_auth.c
      CC  ../src/ap/sta_info.c
      CC  ../src/ap/wpa_auth.c
      CC  ../src/ap/tkip_countermeasures.c
      CC  ../src/ap/ap_mlme.c
      CC  ../src/ap/wpa_auth_ie.c
      CC  ../src/ap/preauth_auth.c
      CC  ../src/ap/pmksa_cache_auth.c
      CC  ../src/ap/ieee802_11_shared.c
      CC  ../src/ap/beacon.c
      CC  ../src/ap/bss_load.c
      CC  ../src/ap/neighbor_db.c
      CC  ../src/ap/rrm.c
      CC  ../src/drivers/drivers.c
      CC  ../src/utils/eloop.c
      CC  ../src/utils/common.c
      CC  ../src/utils/wpa_debug.c
      CC  ../src/utils/wpabuf.c
      CC  ../src/utils/os_unix.c
      CC  ../src/utils/ip_addr.c
      CC  ../src/common/ieee802_11_common.c
      CC  ../src/common/wpa_common.c
      CC  ../src/common/hw_features_common.c
      CC  ../src/eapol_auth/eapol_auth_sm.c
      CC  ../src/eapol_auth/eapol_auth_dump.c
      CC  ../src/radius/radius.c
      CC  ../src/radius/radius_client.c
      CC  ../src/radius/radius_das.c
      CC  ../src/ap/accounting.c
      CC  ../src/ap/vlan_init.c
      CC  ../src/ap/vlan_ifconfig.c
      CC  ../src/ap/vlan.c
      CC  ../src/common/ctrl_iface_common.c
      CC  ctrl_iface.c
      CC  ../src/ap/ctrl_iface_ap.c
      CC  ../src/ap/iapp.c
      CC  ../src/ap/peerkey_auth.c
      CC  ../src/drivers/driver_hostap.c
    ../src/drivers/driver_nl80211.c:17:31: fatal error: netlink/genl/genl.h: No such file or directory
     #include <netlink/gen1/genl.h>
                                   ^
    compilation terminated.
    make: *** [../src/drivers/driver_nl80211.o] Error 1
    [root@hostname hostapd]#
    
Argh! I need to install the libnl-devel package!
    [root@hostname hostapd]# yum install libnl-devel.x86_64
    
Then, re-run "make" :
    [root@hostname hostapd]# make
      CC  ../src/drivers/driver_nl80211.c
      CC  ../src/drivers/driver_nl80211_capa.c
      CC  ../src/drivers/driver_nl80211_event.c
      CC  ../src/drivers/driver_nl80211_monitor.c
      CC  ../src/drivers/driver_nl80211_scan.c
      CC  ../src/drivers/netlink.c
      CC  ../src/drivers/linux_ioctl.c
      CC  ../src/drivers/rfkill.c
      CC  ../src/utils/radiotap.c
      CC  ../src/l2_packet/l2_packet_linux.c
      CC  ../src/eap_server/eap_server_md5.c
      CC  ../src/eap_server/eap_server_tls.c
      CC  ../src/eap_server/eap_server_peap.c
      CC  ../src/eap_common/eap_peap_common.c
      CC  ../src/eap_server/eap_server_ttls.c
      CC  ../src/eap_server/eap_server_mschapv2.c
      CC  ../src/eap_server/eap_server_gtc.c
      CC  eap_register.c
      CC  ../src/eap_server/eap_server.c
      CC  ../src/eap_common/eap_common.c
      CC  ../src/eap_server/eap_server_methods.c
      CC  ../src/eap_server/eap_server_identity.c
      CC  ../src/crypto/ms_funcs.c
      CC  ../src/eap_common/chap.c
      CC  ../src/eap_server/eap_server_tls_common.c
    ../src/crypto/tls_openssl.c:19:25: fatal error: openssl/ssl.h: No such file or directory
     #include <openssl ssl.h>
                             ^
    compilation terminated.
    make: *** [../src/crypto/tls_openssl.o] Error 1
    [root@hostname hostapd]# 
    
Yet another package I needed to install :
    [root@hostname hostapd]# yum install openssl-devel
    
Again, re-run "make" :
    [root@hostname hostapd]# make
      CC  ../src/crypto/tls_openssl.c
      CC  ../src/crypto/tls_openssl_ocsp.c
      CC  ../src/crypto/crypto_openssl.c
      CC  ../src/crypto/aes-omac1.c
      CC  ../src/crypto/sha1-prf.c
      CC  ../src/crypto/sha1-tlsprf.c
      CC  ../src/crypto/sha256-prf.c
      CC  ../src/crypto/sha256-tlsprf.c
      CC  ../src/crypto/sha256-kdf.c
      CC  ../src/crypto/random.c
      CC  ../src/ap/wmm.c
      CC  ../src/ap/ap_list.c
      CC  ../src/ap/ieee802_11.c
      CC  ../src/ap/hw_features.c
      CC  ../src/ap/dfs.c
      CC  ../src/drivers/driver_common.c
      LD  hostapd
      CC  hostapd_cli.c
      CC  ../src/common/wpa_ctrl.c
      CC  ../src/common/cli.c
      CC  ../src/utils/edit_simple.c
      LD  hostapd_cli
    [root@hostname hostapd]# make install
    install -D hostapd /usr/local/bin//hostapd
    install -D hostapd_cli /usr/local/bin//hostapd_cli
    [root@hostname hostapd]#
    
Success! Let's run it :
    [root@hostname hostapd]# hostapd
    hostapd v2.6
    User space daemon for IEEE 802.11 AP management,
    IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
    Copyright (c) 2002-2016, Jouni Malinen  and contributors
    
    usage: hostapd [-hdBKtv] [-P ] [-e ] \
             [-g ] [-G ]\
             [-i ]\
             
    
    options:
       -h   show this usage
       -d   show more debug messages (-dd for even more)
       -B   run daemon in the background
       -e   entropy file
       -g   global control interface path
       -G   group for control interfaces
       -P   PID file
       -K   include key data in debug messages
       -i   list of interface names to use
       -S   start all the interfaces synchronously
       -t   include timestamps in some debug messages
       -v   show hostapd version
    [root@hostname hostapd]#
    
Worked well enough to know we're installed, so let's get it configured. First, we need to grab the hardware address :
    [root@hostname hostapd]# ifconfig wlp1s0
    wlp1s0: flags=4098  mtu 1500
            ether 04:f0:21:26:d5:1f  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    [root@hostname hostapd]# 
    
For multiple SSID's, you might need to "change the MAC". You can do this from the command line as :
    [root@hostname hostapd]# ifconfig wlp1s0 hw ether 02:f0:21:26:d5:30
    
Or, add the new MAC address as "MACADDR=" in the ifcfg-wlp1s0 file for a more permanent home :
    [root@hostname hostapd]# ifconfig wlp1s0
    wlp1s0: flags=4098  mtu 1500
            ether 02:f0:21:26:d5:30  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    [root@hostname hostapd]# ifconfig wlp1s0 up
    [root@hostname hostapd]#
    
Check and ensure it took :
    [root@hostname hostapd]# ifconfig wlp1s0
    wlp1s0: flags=4099  mtu 1500
            ether 02:f0:21:26:d5:30  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    [root@hostname hostapd]# vi ifcfg-enp4s0
    
Create our required configuration files :
    [root@hostname hostapd]# mkdir -p /etc/hostapd
    [root@hostname etc]# cd /etc/hostapd/
    [root@hostname hostapd]# vi hostapd.conf
    
Here is the content of my hostapd.conf file (shamelessly copied from another source) for the trial run :
    interface=wlp1s0
    bridge=br0
    driver=nl80211
    logger_syslog=-1
    logger_syslog_level=2
    logger_stdout=-1
    logger_stdout_level=2
    dump_file=/tmp/hostapd.dump
    ctrl_interface=/var/run/hostapd
    ctrl_interface_group=0
    ssid=wifiname
    hw_mode=g
    channel=1
    beacon_int=100
    dtim_period=2
    max_num_sta=255
    rts_threshold=2347
    fragm_threshold=2346
    macaddr_acl=1
    accept_mac_file=/etc/hostapd/hostapd.accept
    deny_mac_file=/etc/hostapd/hostapd.deny
    auth_algs=1
    ignore_broadcast_ssid=0
    wmm_enabled=1
    wmm_ac_bk_cwmin=4
    wmm_ac_bk_cwmax=10
    wmm_ac_bk_aifs=7
    wmm_ac_bk_txop_limit=0
    wmm_ac_bk_acm=0
    wmm_ac_be_aifs=3
    wmm_ac_be_cwmin=4
    wmm_ac_be_cwmax=10
    wmm_ac_be_txop_limit=0
    wmm_ac_be_acm=0
    wmm_ac_vi_aifs=2
    wmm_ac_vi_cwmin=3
    wmm_ac_vi_cwmax=4
    wmm_ac_vi_txop_limit=94
    wmm_ac_vi_acm=0
    wmm_ac_vo_aifs=2
    wmm_ac_vo_cwmin=2
    wmm_ac_vo_cwmax=3
    wmm_ac_vo_txop_limit=47
    wmm_ac_vo_acm=0
    eapol_key_index_workaround=0
    eap_server=0
    wpa=2
    wpa_passphrase=wifipassword
    wpa_key_mgmt=WPA-PSK
    wpa_pairwise=CCMP
    rsn_pairwise=CCMP
    wpa_group_rekey=600
    wpa_gmk_rekey=86400
    
Let's get a few more files created :
    [root@hostname hostapd]# touch /etc/hostapd/hostapd.deny
    [root@hostname hostapd]# touch /etc/hostapd/hostapd.accept
    [root@hostname hostapd]# 
    
Note, if you forget the hostapd.deny/hostapd.accept files, it will error out with :
    [root@hostname hostapd]# hostapd /etc/hostapd/hostapd.conf 
    Configuration file: /etc/hostapd/hostapd.conf
    Line 8: DEPRECATED: 'dump_file' configuration variable is not used anymore
    MAC list file '/etc/hostapd/hostapd.accept' not found.
    Line 20: Failed to read accept_mac_file '/etc/hostapd/hostapd.accept'
    MAC list file '/etc/hostapd/hostapd.deny' not found.
    Line 21: Failed to read deny_mac_file '/etc/hostapd/hostapd.deny'
    2 errors found in configuration file '/etc/hostapd/hostapd.conf'
    Failed to set up interface with /etc/hostapd/hostapd.conf
    Failed to initialize interface
    [root@hostname hostapd]#
    
And a successful run :
    [root@hostname hostapd]# hostapd /etc/hostapd/hostapd.conf 
    Configuration file: /etc/hostapd/hostapd.conf
    Line 8: DEPRECATED: 'dump_file' configuration variable is not used anymore
    Using interface wlp1s0 with hwaddr 02:f0:21:26:d5:30 and ssid "wifiname"
    random: Only 15/20 bytes of strong random data available from /dev/random
    random: Not enough entropy pool available for secure operations
    WPA: Not enough entropy in random pool for secure operations - update keys later when the first station connects
    wlp1s0: interface state UNINITIALIZED->ENABLED
    wlp1s0: AP-ENABLED 
    
You should now have a wireless network named "wifiname"! Congrats!  But wait! That's not all!  For a down payment of $49.95, you can also get MULTIPLE networks in separate subnets!  No VLAN necessary!  Here's how to order.
    [root@hostname homedir]# ifconfig wlp1s0|grep ether
            ether 09:f0:21:26:d5:d8  txqueuelen 1000  (Ethernet)
    [root@hostname homedir]#
    
First, you need to ensure the BSSID is defined in your hostapd.conf.  Grab the hardware address out of ifconfig :
    [root@hostname homedir]# ifconfig wlp1s0|grep ether
            ether 04:f0:21:26:d5:1f  txqueuelen 1000  (Ethernet)
    [root@hostname homedir]#
    
Then, change the first octet to 02 (meaning it's locally managed), and the last octet to 30.  For example :
    04:f0:21:26:d5:1f
    02:f0:21:26:d5:30
    
Then, throw that value into your hostapd.conf file under the setting of "bssid=02:f0:21:26:d5:30".  The next step is to define your secondary SSID's using stanzas like :
    bss=wlp1s0_0
    ssid=guest
    wpa=2
    wpa_passphrase=Brawnd0! It's what plants crave.
    
    bss=wlp1s0_1
    ssid=nonrouted
    wpa=2
    wpa_passphrase=securityVan09
    accept_mac_file=/etc/hostapd/hostapd.nonrouted.allow
    
Once you restart hostapd, you will note that you have two new interfaces : wlp1s0_0 and wlp1s0_1. These will correlate to the three wireless networks. One is the main wireless network (wlp1s0), one is the guest network (wlp1s0_0), and one is a non-routable network (wlp1s0_1). The non-routable network is where I put all of my security stuff that I play with - for example, I don't want the chinese test hardware dialing home to papa.

So, how do we give them separate subnets? I spent a few days trying to figure this out, wanting terribly to use the defect-standard scripts on the system (before I really found out that you can't use the /etc/sysconfig/network-scripts/ifcfg-*). The "systemctl restart network.service" refused to work with them. It baffled me for a while, until I got tired of the inability for it to work, and simply created a systemd startup file for hostapd that had a post-configuration (I placed mine into "/etc/systemd/system/hostapd.service") :
    [Unit]
    Description=Wireless AP Daemon
    Documentation=http://www.silverhawk.net/search/label/hostapd
    Wants=basic.target
    After=basic.target
    Before=network.target
    
    [Service]
    Type=forking
    ExecStart=/usr/local/bin/hostapd -B -P /var/run/hostapd.pid /etc/hostapd/hostapd.conf
    #ExecStartPre=
    ExecStartPost=/bin/sh -c '/usr/sbin/ifconfig wlp1s0 inet 172.16.64.1 netmask 255.255.224.0 up;/usr/sbin/ifconfig wlp1s0_0 inet 172.16.96.1 netmask 255.255.224.0 up;/usr/sbin/ifconfig wlp1s0_1 inet 172.16.224.1 netmask 255.255.224.0 up'
    ExecReload=kill -HUP $MAINPID
    ExecStop=kill $MAINPID
    PIDFile=/var/run/hostapd.pid
    
    [Install]
    WantedBy=multi-user.target
    
I needed to enable the new systemd startup :
    systemctl daemon-reload
    systemctl start hostapd
    systemctl enable hostapd
    
A reboot, and I was finally online with two networks!

Saturday, November 12, 2016

I Broke the Lathe (Well, Maybe)

I was trying to create one of the gear arbors for a gear depth gauge tool.  I faced the brass, then drilled with a #43 drill bit for the needle underneath approximately 3/4" in depth, then turned about 3/4" of the outside to a half inch diameter.  I threw the home-made knurling tool in place, and tried my hand at knurling :



It worked great, but when I tried to clean the lathe, I realized it had broken (whether that is me or a previous owner) :



Now I need to replace the cross slide.

Saturday, October 15, 2016

First Try at Milling

Welp, I had a few minutes to spend out in the shop, so I thought I'd finish the milling attachment.  I went through the old "L. C. Mason" article that was posted to Vintage Projects (http://www.vintageprojects.com/machine-shop/lathe-milling-attach-plans.pdf).  The original plans were for a 7" to 8" lathe, but my South Bend Junior is a 9".  The instructions do mention "scaling it up" for a 9" to 10" lathe, so I thought I'd take a whack at it :



Of course, with the 3MT spindle taper and a short lathe bed, I needed some end mill collets that would fit the taper inside, without using a collet chuck.  I found a set of 3MT collets that used a 3/8-16 threaded rod, so I ordered those and some end mills.  I ran to Home Depot and bought a two-foot chunk of threaded rod to match.  However, I needed a way to hold it on the other end (gear end of the spindle).  I had a chunk of 1" round stock sitting from the build for the milling attachment project.  I chucked that up in the 4-jaw chuck, drilled a tight hole through the center (for the threaded rod), and put a bevel (a 45 degree bevel) on one end, just long enough to self-center in the spindle through hole.  I turned it round, and then I cut it off flat.  It was PERFECT for holding those collets into that taper :


There is one issue, though - it likes to come loose.  I think I need to put a burr on that threaded rod to prevent the nut from releasing.

Next, I started to finish the milling attachment by milling the face of the table.  I got the two bottom surfaces complete before I ran into an issue :



The issue here is that it wouldn't go low enough to mill all of the surfaces.  Also, I had built the face all the way up, without realizing I'd never be able to mill that high.  The efforts were pretty pointless for that.  The scaling was basically done wrong.

If I were to do it over, I'd only scale the bottom surface (where the milling surface is stacked) - leave the top angle stuff alone.  Then, you simply lengthen the threaded feed screw (on the bottom side), and the ways you build (in the guide, parts F, G, H, and J).  I'd also do it myself, as the t-slots didn't line up right - but the neighborhood kids are now interested in making things (3D printers and metal work), so my job there is done.

Wednesday, October 5, 2016

Addictions Run Deep

Within a week of having my first "machine tool" up and running, I've learned quite a bit (my wife would probably want to see me sometime).

  • Facing
  • Center-drilling
  • Turning between centers
  •  How NOT to orient a tool for the best finish
  • The tool is also critical  (larger tools means stable cuts)
Unfortunately, I didm't have the 4-jaw ready to try learning the technique of parting off.  Instead, I used a hacksaw while the piece was turning.  Silly me.

Once I had experienced facing, I decided it was time to prepare the backplate for the second chuck (I started out with a 3-jaw scroll, and wanted a 4-jaw independent).  That was completed today - the chuck and back plate have been permanently joined.

While I was at it, I needed a better way to store my #2 armstrong tool holders.

I realized that a 3/4" PVC pipe coupling was about the right size, except for a small shoulder inside.  That lead me to salvage a stainless steel printer rod.  I grabbed one of my collets for this and an end-mill, and milled a flat end on the rod (3/8", so nothing I'd readily bore steel with), drilled a hole across it, and turned it into a simple boring bar.




I then chucked a PVC coupling into the old 3-jaw, bored out the shoulder inside the PVC couplings, drilled a cross hole, and screwed them to my wall.  They worked perfectly!



So, I now know I can easily make a good boring bar if I ever have to.  I have two chucks (self-centering/scroll 3-jaw [came with the lathe] and a 4-jaw independent), and I'm half way to having made a milling attachment table (not one of those key-way cutting "attachments", this would be a much more solid attachment).  Forgive the crudeness of the attachment, it was intended to be squared up with the collets and end mills, so I wasn't trying to be completely accurate in setting it up and laying it out.  I'll use side mills for the slots, and I still need to pick up some slot cutters, but at this point, it is somewhat useable.






The next things on my list

Saturday, September 24, 2016

South Bend 9" Junior Lathe LIVES

I finally got the lathe up and running!  This has been a tremendous project, and I can cross this one off the list (yeah, it took less than a year, but it had to be completely dismantled, repaired, and reassembled).  This thing is operational :



I used brass first, as I am not yet ready to do anything else.  I need to learn some operations, first.  In fact, I started to learn my first operations today - that of facing, center drilling, and also turning.

Monday, August 15, 2016

South Bend 9" Junior - Spindle Speeds and Countershaft Pulleys

I tried to use the treadmill motor and one of those BC141 (Baldor) motor controllers so I could have variable speeds.  Unfortunately, that didn't really work out - with the motor controller and that particular motor, it didn't want to drive the lathe.  So, I had to set out to do this a bit differently.  I had on hand a number of 1725 RPM motors, and I needed to get the following speeds : 39, 64, 110, 208, 348, and 596 RPM.

I tossed together a quick calculator to generate the spindle speed, using a countershaft :
Motor RPM :
Motor Pulley Diameter :
Countershaft Pulley Diameter Driven by Motor :
Countershaft Pulley Driving Spindie Diameter :
Spindle Pulley Diameter :
Spindle Speed :

So far, to get close to the original speeds, I need :

a 2" motor pulley
A 5.75 " countershaft pulley
A 4-step pulley with the largest being a 5" pulley.

  spindle based on 2" step : 240
  spindle based on 3" step : 360
  spindle based on 4" step : 480
  spindle based on 5" step : 600

If I change the 5.75" countershaft pulley to a 10" pulley, it would then give me :

  spindle based on 2" step : 138
  spindle based on 3" step : 207
  spindle based on 4" step : 276
  spindle based on 5" step : 345

That's still not slow enough.  Moving to a 10" pulley and a 1.5" motor pulley puts me at :

  spindle based on 2" step : 103.5
  spindle based on 3" step : 155.25
  spindle based on 4" step : 207
  spindle based on 5" step : 258.75

Which is still three times as fast as it should be.

If I add a 1.5" pulley on the countershaft to drive the spindle, I get around 77 RPM.  That is about twice as fast.  That is getting there.  If I change the motor pulley for a 1.25, and add a 1.25 pulley on the countershaft to drive, that gets me to about 53 RPM, which is close enough to create my own pulleys.  So, that "close enough" would be done with :

2x 1.25" pulleys
1 2" pulley
1 5.75 " pulley
1 10" pulley

That will do!

Saturday, July 30, 2016

Motors That Came With the Old Woodworking Tools

A while ago, I posted about being a tool junkie and picking up quite a few tools and that there were five or six motors included.  I didn't go into depth about the motors, because I didn't see tags at a quick glance, and there were many enough that I didn't want to look to make that post even longer than it is.  So, I finally got over my laziness, uh, preference to prevent long posts, and went out to check the motors and identify them.  So, here they are.  The first motor didn't have an identification tag on it.  But, deductions say it is an A/C motor, since all of the rest were.  I don't really have a way to identify it at this point.  So, I'll skip that one.

The second one I pulled out was a Robbins & Myers 3/4HP, 220v A/C motor that spins at 1725 RPM.  Serial number is MM18377TQ, and a brief company history was provided by Vintage Machinery :



The third one I pulled out was a single-phase Westinghouse 315P194.  It is a 1/2 HP, 110v A/C motor that spins at 1725 RPM, and is a cheap motor on eBay ($20?).  It looks like the best candidate for use in the South Bend lathe.  The original motor for the lathe was 1/3 HP, so it should have plenty of power.

 



The fourth one was a General Electric Model 5KH35KG103X.  It's a 1/4HP, 115v, continuous duty A/C motor that spins at the normal 1725 RPM.  The serial number had "WMA" stamped.  On eBay, this would probably sell at around $50 + shipping :



The fifth one was a Dayton single-phase/split-phase A/C motor for 115v, 1/3 HP.  The model number is S55NXCCZ-1691 (number 6K030), and it cranks in the normal-for-old-A/C-motor speed of 1725 RPM.  On eBay, probably around $37+shipping :


The sixth one turned out to be a General Electric model 5KC45AB1107X, a single phase 1/6 HP, 110v A/C motor cranking (surprise!) in at 1725 RPM. :



There were quite a few motors in that lot (6), but none of them are the same.  From a 220v 3/4HP motor to a 110v 1/6HP motor, there are plenty for what I want (you might say over-abundance).  My next task is building a stand for the tools, and organizing things a bit for space.