Tuesday, December 31, 2019

Taxes in US vs Spain

[Work in progress]

Top level, I want to compare couple of countries (US vs Spain) which could be considered quite different from social policies, one often cited as extreme capitalism and the other more of socialist nature (who likes to talk about "el estado del bienestar"). I am not an economist or have experience creating a company so I may miss stuff, but let me give it a try. We would like to learn:
  1. If you make a given salary, how much you get to keep, depending on the place.
  2. And related, what do you get for what you pay on your taxes. Or a bit on the flip side. If you have certain needs in life you have to pay for and the rest of the money you get to keep to enjoy, where is better (assuming you were making the same, which obviously may not be the case).
  3. If you are a company, where is cheaper to hire someone. This is more from the perspective of where would you like to invest. Of course, there are other factors, like how easy is to pull out if things go bad (like the cost of laying off people, etc) or what are the corporate taxes...
So, with we dig in both countries and try to make a comparison, which obviously may not be easy. This will be even more difficult if we try to cover a broad spectrum (low and high income, etc). So, we may just want to pick an example. 

I'll put here the summary table once I get it all. For the time being few posts getting the background info:
  1. How much is to hire someone in Spain?
  2. Income tax brackets in Spain
  3. Income tax brackets in US
  4. Paying taxes in Spain (II): taxes on your wealth.
Cheers!

Thursday, December 26, 2019

Paying taxes in Spain (II)

To continue with the tax topic comparison across places we look at couple more taxes that you may want to be careful with as are not standard across countries but can add up. For this, we look again at Spain, which looks like is going a bit nuts with the taxes (specially when you add all other ones, I need to do a summary comparison):
  • Wealth tax (Impuesto del Patrimonio), i.e., tax not only the income but also the overall wealth (even after one already paid taxes on). If you live in the country, all your wealth across the world is included. If you are not resident, then only the wealth in Spain is counted. (Check retirement plans as you may be able to exclude those, like 401k). This is actually not only for high wealth individuals and it applies on anything beyond ~$500k for any resident of Spain (spends there more than 183 every year). On top of that, it is not homogeneous across communities... Here is a breakdown for communities. To see the difference, having 4M Euros would cost you 0 in Madrid but ~40k in Catalonia. Note: this is currently (as of 2018) a temporary tax that is extended yearly by the government. One day they may not but I wouldn't count on it for many years plus there is always the risk of being brought back (it has been extended yearly for already 7 years or so...). For instance, as mentioned, on Madrid is zero, but it is almost a given that a change on local government (from right to left) would immediately increase this. 
    • The way to compute it in Catalonia is:
      • Add all your wealth
      • Subtract up to E300k for the value of your permanent residence
      • Subtract E500k (exemption rule). In other parts of Spain is E700k but in Catalonia...
      • Apply the following table:
      • So, for instance, say you got E2M and live in a E200k place. The "Base Imponible" is 1.8M, but in Catalonia the first 500k are exempt, and as such, the "Base liquidable" is 1.3M. Looking at the table above, the first 668449.75 pay 2632.21 and the rest (1.3M - 668449.75 = 631550.25) pay at 0.945% = 5968.15. Hence, you got to pay a total of E8600 that year.
      • Important: there is a note saying that there is a cap on how much you pay on taxes in relation to your overall income "Exclusivamente para los sujetos pasivos sometidos al impuesto por obligación personal, la suma de la cuota íntegra del Impuesto sobre el Patrimonio conjuntamente con las cuotas del IRPF (cuota íntegra general y cuota íntegra del ahorro) no podrá exceder del 60 por 100 de la suma de las bases imponibles, general y del ahorro, del IRPF." Examples:
        • Say that, following with the example above, you make 50k/yr and pay 10k on taxes on that money. 60% is 30k. As (E8600+E10k)<30k, you got to pay the E8600 for patrimonio (full amount).
        • Say that you make only 10k and that falls below the tax line, so, no tax pay. 60% of 10k is 6k < 8600 so you are paying 2600 more than you should. So, you got to actually pay E6000
        • There is actually a limit on how much you can deduct from that tax. For instance, say that you made zero Euros that year. Then you would be paying 8600 too much, but they don't allow you to avoid paying all those. You can only remove 80% of the 8600 = 6880E. I.e., you still have to pay E1720.
  • There is also a tax on real state if you are not living on it and has no rental gains either (say that you keep the place there as second residence): https://www.strongabogados.com/impuestos-no-residentes.php That's actually my case (where I own a condo in Barcelona). Looks like I got to pay for the condo 24% of 1.1% of the value of the place (if it was reviewed in the last 10 years, which it was). The good part is that the official value of the place ("valor catastral") is usually not as much as the market value of the place. And yes, that includes the parking spot. (you got to file twice, one for the flat and one for the parking spot):
    • Use form 210. Most of it is straightforward. Remember to pay only for the days that you were owner of the place. For instance, if you buy the place on March 23, then declare 284 days out of 365. For instance: 284*88749.24/365 = 69054. 
    • To fill the form 210, follow these instructions. The form is in here (under "predeclaracion" as you fill that and then take it to the bank). It's filled on the browser and then generates a pdf to bring to the bank. You can actually export it and next year you just import it, change the dates and generate a new one. Also when you take it to the bank, you can print double sided. The bank will give you back one of the forms stamped for your records.
    • For those who think that I could put it as AirB&B, actually you can't without a municipal license, which the city doesn't give anymore.
  • Beckham Law: a bit of good news... this is a regime within the Spanish tax law for foreign hires, which applies for the first 5 years a similar tax structure to the non-residents: flat income tax at 24% (applies only to Spanish income) and excludes overseas wealth tax. In fact, you don't even have to submit the 720 (declaration of overseas wealth). See more here and here.
Overall I do believe that wealth unbalance is a bad thing. Unfortunately, these laws seem to be less about balancing wealth (given the relatively low limits they are applied to) and more about getting more money into the coffers of the government (which honestly, is extremely wasteful... that would be a different post). Certainly those individuals, specially those with no ties to Spain, may want to take this into account when looking for places to invest or to retire to.

Cheers!

PS2.: If you are a Spain resident, don't forget to declare your goods outside the country with model 720.

Sunday, December 22, 2019

Reforestando España - Proyecto Ardilla

According to some famous guy, or a legend... well, I don't know where I heard this, but someone said once that during the Roman empire a squirrel could cross Spain from North to South without touching the ground, from tree to tree.

Well, that was long ago, and now, unfortunately, he would have to walk most of the way... So, the other day the thought of all Spaniards getting together and making that possible crossed my mind. What a nice goal to unite people.

So, here I am starting to research that. Let's start by random thoughts:
  1. Looks like actually some folks running for president had promised planting lots of trees... LOTS of them. 800M once!
  2. In Spain there are 7G trees in 18.5M hectares (100x100sqm, 2.5 acres), from a total surface of 505k sqkm (50Mhectares). Not bad, actually.
  3. How are we going to go over roads? I guess under a bridge or above a tunnel...
  4. The Bonn Challenge
  5. Reforesta.es
  6. How much to plant a tree?
    1. $0.1 to $1.4/tree depending of a lot of factors.
    2. In your backyard, depends on the size, can go to thousands of dollars.
    3. Cuanto cuesta reforestar una hectarea (Mejico) Un monton de informacion buena. They say about $4.5k. They say about 1k trees per hectare. And the price includes everything (including manpower, watering...) for the first year, but no yearly support.
These guys have a blog on los Monegros. A desert in Spain. One in the comments talks about reforesting it. It looks like this desert may have been direct consequence of human actions.
A nice article on the topic. And another one but about Cantabria and Burgos reforestation. Mentions $4k per hectare.

Other random links (while I get time to sort all this through):


By the way, the link above is an excellent source of other data (like how much water is consumed, what is the cost, how much trash is generated, population, health system, expenses...)

Anyhow, posting this to at least put the idea out there...
Cheers!

PS.: for kickers, ardilla.blogspot.com is taken. And like that almost anything I looked for: reforestar, reforestando, squirrel, dearboles, even proyectoardilla... amazing.

Friday, November 29, 2019

Xiaomi Mi 9T

Want to buy this phone for my mom ($300!!). Specs look really good. Only weakness from my view (used to getting the best camera phone out there) is the camera... But she'll have plenty. Some useful links:

And for me: :)
Second runner up: OnePlus 7 Pro

Saturday, October 5, 2019

Port mirroring - Netgear GS105E

It is interesting but as time goes by, products get better and it gets harder and harder to find simple/not perfect products. But sometimes, not perfect is what one needs to do the job. That is the case when you want to listen with a computer to the network traffic from a different computer.

Traditionally there used to be hubs, little boxes with, say, 4 ports, where whatever you connected to one port went to all other ports (basically like shorting the wires). Nevertheless, that was cluttering the network (no reason to send to a cable something that is not for that computer). Switches started to appear (and were much more expensive) where they would only route between ports those packets that were directed to whatever was hanging from that port. And with time, now, it is basically the only thing you can buy. To get a hub is really tough these days. One can check eBay or for instance this

So, I wanted to monitor the packets going in and out from one computer with a different one, but the ports on my wireless router were not passing the packets from the source computer port to the "spy" computer port (because obviously were not addressed to it). So, given that hubs are hard to find, bought a Netgear GS105E which is a switch that has "port mirroring" function.

Note: careful, a splitter (like this one) will not work either.




Friday, June 28, 2019

Exchange rates on buying stuff

My friend told me that when you buy something in a foreign place with your card, and the machine offers you to pay on the local currency or on your currency, you should choose the LOCAL one. Basically when you do that, your card is the one doing the exchange, while if you choose your currency, they do the exchange and you pay that on your currency. Their exchange is likely to be worse than your card's exchange.

So, I just tested this. I purchased a flight ticket on Cathay's website and the default was HKD. The total was 2638 HKD. They give you the option to pay with USD, but when I selected that it said 348 USD. Google exchange rate was giving actually 338 USD. So, I did what my friend suggested and picked HKD. Later checking my credit card bill, sure enough, I had actually paid 338 USD! :)

Great!

Sunday, May 19, 2019

GTI mkV cargo trunk liner mat

Stupid oil spill on my mat made it very messy...
Trying to clean it but if I need to buy something to replace it, the original is almost $200!?! You can also get them use for $100... These may not be bad alternatives for about $30 (are soft though so gotta put something underneath):

In the junk yard didn't find any :(
Volkswagen VW Golf 5 6 MK5 MK6 Golf GTI R R32 Rabbit 2004-2014 

"Looking for a trunk liner for a VW GTI mk5 2007. If you got any Volkswagen Golf or GTI or Rabbit or R32, from the years 2004-2014 will work."

Sunday, May 12, 2019

Replacing ipod adapter from GTI MKV with AUX in

You are here, so, I'll skip the why :)
The problem is well described here: "Basically the factory iPod adaptor replicates a external 6 disc CD changer to the headunit in the dash. This is why the iPod dock is limited to 6 playlists. In the bottom of that tray the dock is in there is a 12 pin connector that plugs in to a printed circuit board and the dock plugs in to it."
You can't just bypass plug to that connector on the audio pins of the ipod connector.

The CableJive solution looked promising. On one side it plugs to the ipod connector (tricking the controller to think that it is an ipod) and on the other had the aux. But in the page says it does not work well with VW: "Does not work with: ALL factory installed car audio systems 2008 and newer. Any and all factory systems (pre & post 2008) from Volkswagen, Audi, Nissan, Infiniti, Toyota, Lexus, & Mazda "

A basic ipod to aux adapter like this one doesn't seem to work either, based on what they say on the description :(

Found also this one from Avery but it seems to work for VW MDI. I.e., watch because it is not the same and in the list actually there is no VW listed!

The enfig looks like the easiest way There is actually a whole list of products and that is the question, what to buy. It looks like they were using the VWT-AUX ($70). Somehow they recommend the VW1-AUX ($60) but I think the internal connector won't work (see this video). More videos here. BUT now they are recommending the GW1LVWT. I think the difference is that it has the stupid iPod cable WHICH I DON'T WANT. I think all the boxes for the wired version are basically the same and the difference is on the cables. So, for instance, the other version with the VWT-IPDU-AUX includes the USB (and also the aux cable).

The only thing with this approach is that we need to find a way to get the cable out so that we can plug it... But maybe instead of doing it through the top (drilling a whole in a new box) we can do it through the bottom (see how they install the cable from the front switches by the stick to the back).

The other possibility would be to get the BT one. There are two versions for that (one with a full BT box supporting calls...) and the other VWT-BTA-AUX which basically is like the above but has a BT interface cable (and still supports the aux). That is $20 more: $89.99. The AUX cable actually is probably not far from that so I think I'm just going to pay for this... Kind of pricey to remove some thing that I hate from the first day :(.

BTW, it seems that actually this is the manufacturer but their direct price is too high!

Saturday, March 9, 2019

Understanding OBD

Under construction

Originally I had planned to talk about OBD Eleven here, but for the time being I am just going to describe OBD interface and how it works...

OBD Protocol:
This page by Klav Karr is very complete. Check all the info, not only that page, like the hardware level info and the standard fault codes.
Link
Wikipedia OBD
Wikipedia PIDs (OBD Parameter IDs)

This guy explains what adaptation, long coding, etc... is. Then posts a lot of the info corresponding to all those codes. Notice that OBD calls

Somehow there is this term out there about "measuring blocks". Not sure if it is universal or a function name on the VCDS software (from Ross-Tech). Regardless, what matters is that all the info you can pull from the car through OBD is divided in groups of 4 registers. Somehow in OBDEleven they talk about "channels" instead of groups. Regardless, each group or channels has 4 values (each for one thing, and not always all are used). Ross-Tech info on standard measuring block group. An example of key groups for my fuel cuts debugging (can see more of the word usage here) is listed below. I highlight in red the ones that I am finally plotting for debugging:
  1. Group 1:
    1. RPM
  2. Group 2:
    1. RPM (yes, again, just to illustrate that there can be repeated values)
    2. Load (%). I believe this refers to the car engine load (?)
  3. Group 3:
    1. N/A
    2. N/A
    3. Throttle (%)
  4. Group 103: (notice how the previous link actually has different stuff in here, as I think there are no standards...)
    1. Fuel pressure (Low). Low means low pressure, not low limit or something like that. It is basically the one produced by the in-tank pump (lpfp).
  5. Group 106:
    1. Fuel pressure (High). High here refers to the high pressure and this value should be the same as the group 230 #2.
    2. Load (%). The word load applies to different engines... In this case it is referring to the LPFP and it has nothing to do with the group 2 #2. As these pumps are usually PWM pumps, it also refers to the duty cycle of the control signal.
  6. Group 230:
    1. Fuel Rail Pressure: Commanded Fuel Pressure (aka specified). Fuel rail refers to the high pressure circuit, the one hitting the cylinders. Commanded because is what the ECM wants to get but controlling the hpfp.
    2. Fuel Rail Pressure: Actual Fuel Pressure.
    3. Fuel Rail Pressure: Fuel Pressure Difference (between 1 and 2). You can just compute this but I guess they provide it in case you want to plot that for debugging, real time...
  7. Group 231
    1. Fuel Pressure: Commanded Fuel Pressure (aka specified). Usually, if nothing is said, fuel pressure refers to the low one. Sometimes they say "Low" (as used above). This number should be same as group 103, #1.
    2. Fuel Pressure: Actual Fuel Pressure.
    3. Load (%) refers here to the load of the in-tank fuel pump (lpfp). Same as group 106 #2...
Good news is that you can't break anything by looking at this. Looks like OBD computer gives not only the register but also what the units are. So, the software can try to interpret the Byte (?) it gets. Need to learn more about the OBD memory. It also looks like these may not be standard across vehicles. Probably some are but many are not.

In OBDEleven, you access it by going to the right control unit and clicking in Live data. Once there you can also plot it (click the little graph icon on top). It is annoying because I don't think you can save the graph settings so every capture you have to retype it. Got to understand this better...

Can you really buy an OBD reader for $2?!?
The car hacker handbook

OBD for VW GTI MKV

This post is under construction. Probably don't want to spend much time on it...

Trying to find what to buy to monitor my HPFP or errors (see other posts on this), although now the car runs nice (after the spark plugs job. Update: it doesn't, see debugging here...). Here is what I learnt:
  1. VCDS® HEX-V2® Enthusiast: The VW tool by excellence. $200. Uses USB.
  2. BlueDriver seems to be well recommended, but not sure it allows me to program the car. It works with many cars. Free app but can't be accessed from other apps.
  3. OBDEleven: lots of people says this is good. Get the PRO for about $80 that allows to program the car... Seems to work only on VW family cars... (Audi, Skoda...). Nice app, you can do everything you want yourself at low level but if you want click-only easy type of mods got to pay. I bought this one as it felt like a good trade-off. Almost regretting not to spent the $200 on the #1 but it's doing ok. My review/explanations here
  4. Open source: but still hardware is expensive because uses some expensive MCU board... Still, the info on that site can teach us how to do ourselves one, if one day we want to.
I may update this back based on my learnings... Just putting it out there.

Saturday, March 2, 2019

GTI VW MKV P0087 P2293






Very quick entry in case someone struggling with those codes...
  1. As you already found on the web, this could be a cam follower going bad. In the MKV people says that this can happen quite often and then the whole camshaft has to be replaced (because the high pressure fuel pump (HPFP) eats away the cam. That's a $1k job in the dealer + all the other stuff to remove the metal debris from the car. Not nice. So, if you get this code or EPC light and the code is not going away go straight to the dealer. Usually this issue also trigger limp mode (reduce engine power) for safety.
  2. Nevertheless, in my case code came and disappeared after turning on/off the car. Still I went to dealer and the cam follower was ok. Actually they even didn't know what I was talking about when I told them that I read it was an issue with the car. They even didn't have one in stock! Anyhow, they told me there was an error code with the HPFP solenoid (2294) BUT I actually didn't do the job (they said it would cost $550 + $180). They still wanted to charge me the $180 even when they already had the pump out! Instead of putting the old pump in I ask them to put the new one in but they didn't want to do that for the same price as changing the follower >.>
  3. Anyhow, I was planning to do it myself as it looks quite easy (google it...). Nevertheless, I first replaced my spark plugs (I had got a code back 6 months ago that never came back). And boom, car seemed to work beautiful... Probably because that needed fixing too. But...
  4. Update: few days later I lost power several times in high revs. No engine lights up, though. I am going to get the OBD reader to see if I got any codes...
  5. My dad said that it could be the fuel filter (actually car 110k miles and I don't think I ever changed it). Maybe in some routine maintenance long ago, but don't recall. The piece is WK69 6.6bar (although for some mistake I ended up using a 6.4). This guy explains what the 3 pipes do on the filter and what is the regulator. So, found this about how to change it:  
    1. Youtube - It is for an MK6 but really well explained.
    2. Forum write up - I think the best for those hoses is to remove the two rear clips, then remove the filter from the holder. That allows for better finger access to the other clip. And let the car sit overnight and do not open the doors in the morning (as that primes the pump and increases the pressure). Use eye protection! Also I would put a piece of cloth around the connection so that muffles any squirting.
    3. https://forums.vwvortex.com/showthread.php?5537643-Fuel-filter-change-on-07-MK5
  6. One guy says to put the ignition key on the AC position (power on without turning on the engine?) few times for 30s to purge the fuel line. 
  7. Called a different dealer and they charge me $495 for the pump! Wonder how come they have different prices but anyhow, the Hitachi one on Deutsche Autoparts is $235!
  8. This has a nice explanation of the P2293 and P2294 codes. Only thing is that it seems to say that with voltage, the regulator opens increasing the pressure but a video below says the opposite. Maybe this is talking about the LPFP and the video certainly is talking about the HPFP.
  9. The 2293 is the code that I see all the time. The 2294 is the one that the dealer saw. Not sure I still have it now. So, I still don't want to buy the hpfp till sure. Notice how, for the 2293, they say that a clogged filter could be the reason. People also points to the LPFP or its control module. For the 2294, they said to check the wiring going to the fuel pressure regulator as some times animals chew on it! AMAZING. I saw an empty shell of a nut cracked open inside. This could totally be the reason. Another clue may be that temperature doesn't seem to make a difference (?). All days were actually very cold but things didn't look worse with warmer weather.
  10. Nevertheless, found this ross-tech link of all the codes and it clearly says "Fuel Pressure Regulator Valve (N276): Mechanical Malfunction". As possible solutions does mention fuel filter, for instance:
    1. Check Measuring Values for Fuel Pressure
    2. Check for bent/squeezed Fuel Lines
    3. Check Fuel Pressure System for Leaks
    4. Check Fuel Filter & Filter in Fuel Pump
    5. Check Fuel Quantity supplied by the Fuel Pump
    6. Check Pressure Limiting Valve installed on the high pressure fuel rail when applicable
  11. How about the P0087
  12. N276 valve is the solenoid (fuel pressure regulator). In this link says that ohming it out should show 25 to 30 Ohms. See THIS FULL REPAIR MANUAL for more details. It tells you also how to follow the control wire back to the ECU.
  13. The hpfp can get to 120 bar (normal is between 30 and 110) while low pressure is about 6 bar. Here says that low pressure rail should be 0.5 to 5bar. I wonder if this is reported somewhere in the OBD. 100 psi is about 6.9 bar.
  14. Fuel trim explanation in detail, another level up.
  15. Return vs Return-less fuel systems. Mine is probably return-less because of emissions.
  16. How hpfp system works and how the pump itself works. Notice here that when no voltage is given to the regulator the pressure actually drops (i.e., solenoid must be closed not letting fuel into the HPFP). This is the opposite of what the video says.
  17. Found in the manual how to check the fuel delivery system
  18. Coding. Checking fuel pressure codes here.
  19. Found a kick-ass document describing the whole fuel system: Service Training, Self-study programme 334, The fuel system in FSI engines
  20. Update: changed the fuel filter. Car sounds better. Codes still there but they are from yesterday when I was messing with the hpfp and the intake flow sensor was disconnected. Reset them. Now measuring pump pressure with OBD2. Codes came back. Got a new one too: P310B. This actually now seems to point to the LPFP! I guess changing the filter did something? As it can be seen in the video, the duty cycle should be lower but I am getting very high although the pressure is good
  21. With OBDEleven one can click on gages to see a value, but if what you want to see it's not there, you can go to the control unit. I created a separate post on OBDEleven.
Will post back after I do this change and see if my car goes back to normal...
Fuel system of the FSI engine.


Check your lpfp like this
P310B

  1. This guy says that "Generally lpfp issues you have stalling, while hpfp you can still limp it around". That would mean is my HPFP

They say you should hear it click
Can the HP change so fast? I guess so. The other thought would be the sensor, but why the cuts would happen related to the acceleration. A sensor fail should be uncorrelated with that.
It is pretty clear that the load on the LPFP goes to 100% only on reaction to drops on HP, but not so clear on how to get it out of there. Why gets stack

Drive next day after fix
Drive to dinner Everything looks nicely in place. LPFP between 30 and 40%. Most of the drive on secondary streets.
Drive to run. First and last part on secondary streets. Middle in highway.


My forum post

The post on the MKV forum

Nice doc on GTI FSI engine
P310B causes
Another good video of how GDI (gasoline direct injection) works
Sponsors that helped create some of the videos I watched:

Wednesday, February 20, 2019

Fixing the Chuango Alarm


For some reason the remote and sensors got unpaired and the alarm didn’t react to them. The RFID tags work (although I don’t think they do anything either but at least are detected).

Things that didn't work

a/ Trying to pair them by the standard method (press disarm code >> tape key >> sensor or remote) didn’t work.

b/ They say to press the tamper switch (on the back of the control box) 3 times in 3 seconds (SMS texting 21 looks like it does the same). When you do that it erases the disarm code back to factory (1234) and the RFID tags. Note: when you do that, at the end of the 3rd press you got to keep pressing the tamper switch or else will trigger the alarm. If that happens, even the disarm code will not stop it?!? Fortunately the SMS still works.

Things that worked

The above didn’t do it and still didn’t detect the remote or the sensor. I don't think it needs to be done to do the stuff on bottom (c), so, I would try first the following but if it doesn't work, try the above first (b) and then the following (c) below.

c/ Basically you need to use the switch on/off (the switch is on the other cover, where the battery and power adapter plug are). If you switch it off nothing happens (no beep). Switch it back on and then the reprogramming method above (a) works! I.e., press disarm code (1234)* >> tape key >> sensor or remote, you’ll get one beep. Second time you do this you’ll hear two because it was already paired.

Now everything is back to life.

Note: when the alarm is disarmed, you can unplug it and move it…
* If you didn't do (b) not sure what is the disarm code (1234) or whatever you got already programmed in. Maybe try the other if one doesn't work...